gulp-webpack-starter

Gulp Webpack Starter - fast static website builder, based on Gulp tasks and Webpack bundling

Github星跟蹤圖

Gulp Webpack Starter - fast and simple web development toolkit.
It uses Gulp task runner and Webpack bundler.
The starter perfectly fits building static HTML templates
or speeding up WordPress theme development.

Version 2 is released :tada:.

Easy to start, nice to use. Check it out! :octopus:


List of Content

  1. Features
  2. Getting Started?
  3. Contributing
  4. Examples

:gift: Features, Features, Description, ------------------, -----------, CSS, SASS, Autoprefixer, gulp-purgecss, JS, Webpack, Babel, Live Reload, BrowserSync, Webpack Dev Middleware, Webpack Hot Middleware, HTML, gulp-file-include, Images, gulp-imagemin, SVG sprite, gulp-svg-sprite, ## Getting started?

:closed_book: Recommendations

Make sure you have installed the following:

  • Node.js(Recommended to use Node.js >= v10.16.0)
  • npm or yarn.
    In this tutorial we use yarn, but you can use npm.

:dart: 1. Static HTML templating

Step 1 - clone

git clone https://github.com/wwwebman/gulp-webpack-starter [my-static-template-project-name]
cd [my-static-template-project-name]

Step 2 - run

cp .env.dist .env

yarn
yarn start

Start files modification under [my-static-template-project-name]/dev/* to feel a great
development experience.

Cool and pretty easy, right?


:eyes: 2. WordPress

1. Preparation

It can be setup in a number of different ways, but we would like to describe the simplest:

Please be sure of the following:

  • WordPress website is available under http://localhost/[awesome_wp_project]
  • WordPress Theme exists

Note: folder naming on different OS can differ.

cd [awesome_wp_project]/wp-content/themes/[theme_folder_name]

git clone git@github.com:wwwebman/gulp-webpack-starter.git [frontend_folder_name]

cd [frontend_folder_name]

cp .env.wordpress .env

2. Modify .env

Required

Set correct values to BROWSER_SYNC_TARGET and BROWSER_SYNC_PUBLIC_PATH variables.

  • BROWSER_SYNC_TARGET - refers to WordPress website installed locally
  • BROWSER_SYNC_PUBLIC_PATH - refers to the relative pathname of bundle.js in the browser.
Not required

All compiled files land to themes/[theme_folder_name_folder]/assets.
Modify ROOT_DIST to change the destination.

3. Double check if assets attached in [theme_folder_name]/functions.php:

function enqueue_styles()
{
  wp_enqueue_style('custom', get_template_directory_uri() . '/assets/css/bundle.css', [], null);
}

add_action('wp_enqueue_scripts', 'enqueue_styles');

function register_scripts()
{
  wp_enqueue_script('custom-js', get_template_directory_uri() . '/assets/js/bundle.js', [], null, true);
}

add_action('wp_enqueue_scripts', 'register_scripts');

4. Run

cd [theme_folder_name]/[frontend_folder_name]
yarn
yarn start

This is cool, isn't it?

If you still have a problem, let us know by opening an issue.

Commands

yarn start // Runs development mode
yarn build // Compiles assets in production mode

License

MIT License, Copyright © 2015-present, Dmytro Chumak.
See LICENSE for more information.

主要指標

概覽
名稱與所有者wwwebman/gulp-webpack-starter
主編程語言JavaScript
編程語言HTML (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2017-02-02 11:00:57
推送於2023-07-18 20:43:12
最后一次提交2022-02-11 22:15:40
發布數3
最新版本名稱v2.1.0 (發布於 )
第一版名稱v1.2.0 (發布於 )
用户参与
星數216
關注者數15
派生數40
提交數211
已啟用問題?
問題數26
打開的問題數1
拉請求數53
打開的拉請求數6
關閉的拉請求數7
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?