Simple webpack boilerplate for es6 front-end projects
First, install Yeoman and generator-na-webpack using npm (we assume you have pre-installed node.js).
$ npm install -g yo
$ npm install -g generator-na-webpack
Then generate your new project:
$ yo na-webpack
- The directory structure of generated project would be:
├── dist/
│ └── index.html
├── src/
│ └── index.js
│ └── styles/
│ └── index.css
├── .gitignore
├── .eslintrc.json
├── package.json
├── package-lock.json
├── server.js
└── webpack.config.js
dist
folder contains html files, you can add more of them. ( and when you build the project, the transpiled js files would be here) This folder can be directly published to github-pages after buildingsrc
folder contains the css and js files which you would develop with
- run
npm install
── it would install all dependencies - For development run
npm run dev
── you can start coding now and go to the urlhttp://localhost:9000
in your browser - To build the project run
npm run build
── this would output all the js and css files into assets folder
Enjoy!
MIT © Navarjun