Webpack project setup, suitable for both websites/web apps.
- 🔥 webpack, webpack-dev-server (config splitted into webpack.dev and webpack.prod)
- 💪 babel (env presset)
- 🦄 scss support, postcss autoprefix, normalize.css included
- 🖼️ image support (png|jpg|gif|svg)
- 💅 prettier configured
If you want to use background: url()
inside *.scss
file, always create path relative to scss folder, even if the current .scss file is, for example, inside modules/
folder.
/* current location: scss/modules/_somefile.scss */
background: url('../assets/mypicture.png'); 👍
background: url('../../assets/mypicture.png'); 👎
css-loader will ignore path starting with /, to prevent that behaviour add option "root: '.'"
# install dependencies
yarn install / npm install
# serve with hot reload at localhost:8080
yarn dev / npm run dev
# build for production @dist/ folder
yarn build / npm run build