Directory of your assets in /assets with:
-- assets/css -- assets/js -- assets/img -- assets/font
npm init
npm i --save @symfony/webpack-encore
To add SASS loader in webpack
npm i --dev sass-loader node-sass
Compile asset once
./node_modules/.bin/encore dev
Recompile assets automatocally when file changes
./node_modules/.bin/encore dev --watch
Compile & Optimize your assets for production
./node_modules/.bin/encore production
Bonus: To use HMR on Webpack Server, just:
./node_modules/.bin/encore dev-server
In this here:
webpack.config.js
A Symfony project created on June 16, 2017, 8:00 am.