Git Product home page Git Product logo

wwwebman / gulp-webpack-starter Goto Github PK

View Code? Open in Web Editor NEW
216.0 16.0 40.0 3.64 MB

Gulp Webpack Starter - fast static website builder. The starter uses gulp toolkit and webpack bundler. Download to get an awesome development experience!

License: MIT License

HTML 4.26% JavaScript 95.59% SCSS 0.15%
gulp webpack static-site-generator svg-sprites static-site-generation browsersync yarn templates gulp-tasks wordpress-development

gulp-webpack-starter's Introduction

webman.pro ๐ŸŽ‰ gulp-webpack-starter

Gulp Webpack Starter

Contributions Contributors License Travis CI Gitter Chat

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 ๐ŸŽ‰.

Easy to start, nice to use. Check it out! ๐Ÿ™


List of Content

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

๐ŸŽ 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?

๐Ÿ“• 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.

๐ŸŽฏ 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?


๐Ÿ‘€ 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 [email protected]: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.

gulp-webpack-starter's People

Contributors

dependabot[bot] avatar ericconstantinides avatar renovate-bot avatar scallemang avatar wwwebman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gulp-webpack-starter's Issues

ERR_INVALID_ARG_TYPE(name, 'string', value)

Hi guys.
I m getting the bellow error.
Do you have any advice?

Windows 10 PRO
Node v10.16.0
npm 6.9.0

internal/validators.js:125
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
at validateString (internal/validators.js:125:11)
at Object.join (path.js:427:7)
at Object. (E:\new-bb\demo\config.js:52:56)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)

Thanks

[GWS 1] browserSync configuration is broken for proxy

@scallemang has found bug after integration starter in Wordpress.
Description:
... I'm trying to use it inside a local WordPress project using MAMP. I cloned your repo into the theme folder, and I added a proxy to the config.json ("[project].dev") and changed the port to 8080 in the browserSync.js file. I also removed 'html' from the default and watch tasks. When I update the helpers.js file, the page keeps refreshing. (See link.) Are you able to advise me what I'm doing wrong?

Screenshot of console errors

[GWS 2] Reloading all the time

Hello,
Thank you for sharing...
I have discovered that when modifying js code, the page is loading over and over and never stops.
I have seen that thanks to the browsersync notification and dev tools that keeps on blinking all the time.
Any clue ?

[GWS - 9] Structure changes

  1. Replace config.json to /tasks/
  2. Rename /tasks/helpers folder to /tasks/lib
  3. Rename webpackConfig to webpack.config.js and replace one folder up
  4. Remove gulp-util plugin

About Deploy

Hi Mate..
Thanks for great resources. I just want to ask where i can config server details for deploy on hosting server?

Not found bundle.js

I got issue while compiling js. Its working on local but while i have upload to server it won't work

image
there is no js folder inside dist folder

image
on live server when i try to open bundle.js

Infinity refresh on the Google Chrome

Expected Behavior

This the same case as #35

Current Behavior

I don't use WordPress, so I don't use proxy mode.

Steps to Reproduce

  1. Everything is OK except JS files.
  2. The result of each change on the JS files is infinite refreshment on the browser.

Context

  • OS: Windows 10 64bit Version 1909
  • Node.js 8.9.4

Page in the browser in infinity refresh

Expected Behavior

Normal project reassembly after edit and compile JS file

Current Behavior

Page in the browser in infinity refresh

Failure Information (for bugs)

Steps to Reproduce

Detailed steps for reproducing the issue.

  1. clone repo on locale pc
  2. yarn
  3. yarn start
  4. change any JS file
  5. task manager after compile JS file in a loop (page in the browser in infinity refresh)

Context

  • Operating System - windows 10 1803
  • Node version - v8.11.3

Browser-sync streaming

Thanks for the great starter!

What is the purpose of streaming everything. Does that really make sense?

.pipe(reload({ stream: true })));

Please check the documentation. I think the parameter stream: true is deprecated

Gulp-Webpack-Starter not for Gulp 4?

After installing the node modules and run the command "npm run start" the script exists with an error

assert.js:385
throw err;
^
The setup is the same that is in this repository.

Infinite loading to all browsers

Expected Behavior

This the same case as #35 and #55

Current Behavior

I don't use WordPress, so I don't use proxy mode.

Steps to Reproduce

Does not have any frequency, sometimes it does when I save the html or JS etc

Context

OS: Windows 10 64bit Version 1909
Node.js 10.16.0

[GWS - 13] Big js bundle file size

Expected Behavior

Smaller size of bundle.js (faster compile)

Current Behavior

It takes very long to compile js. The bundle.js file is very big.

Why no webpack.config.js?

I am new to webpack, but every setup has a webpack.config.js. Is there a reason why you have used this file?

Yarn start under Windows svg sprite problem

Expected Behavior

_sprite.scss should be created inside dev folder:
C:\nodejs\api\dev\sass\parts\vendor_sprite.scss

Current Behavior

_sprite.scss is created inside dist/dev folder:
C:\nodejs\api\dist\dev\sass\parts\vendor_sprite.scss

Failure Information (for bugs)

when i run

yarn start

i get this error:

[12:02:07] gulp-notify: [Error running Gulp] Error: dev\sass\parts\vendor\_icons.scss
Error: File to import not found or unreadable: sprite.
        on line 5 of dev/sass/parts/vendor/_icons.scss
        from line 8 of dev/sass/parts/vendor/_index.scss
        from line 11 of dev/sass/bundle.scss
>> @import 'sprite';

   ^

Steps to Reproduce

1.Download gulp-webpack-starter
2. run in console

yarn
yarn start

Context

Windows 10 home
npm version 6.4.1
node version v10.10.0

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.