A barebone eleventy and webpack template. Fork and go.
- Barebone eleventy (literally ๐ฑ)
- Fast build with per env configs (babel-env, postcss-preset-env, webpack...)
.js
(ES6, Babel and its polyfills).css
(Sass, Autoprefixer)- Prettier for formatting
Live demo https://eleventy-webpack.netlify.app
First install the dependencies:
npm install
Then you can:
Command | Description |
---|---|
npm run start |
Run your website on http://localhost:8080 |
npm run build |
Build your production website inside /dist |
npm run format |
Run prettier on all filles except /dist |
npm run analyze |
Output info on your bundle size |
That's it.
Webpack is used when:
- Any changes to
assets/scripts
orassets/styles
is watched and rebuilt by webpack. - The new files are appended to the ignored file
_includes/webpack.njk
thanks to html-webpack-plugin. - Eleventy sees the new
_includes/webpack.njk
and rebuild.
Any other changes is picked up normally by Eleventy (see .eleventy.js)