Updated recipes of webpack-encore.

This commit is contained in:
Jan Böhmer 2020-01-07 19:16:39 +01:00
parent 5d86ba776a
commit 4e4b10ffbd
6 changed files with 48 additions and 6 deletions

View file

@ -22,6 +22,12 @@
var Encore = require('@symfony/webpack-encore');
const CopyPlugin = require('copy-webpack-plugin');
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
// directory where compiled assets will be stored
.setOutputPath('public/build/')
@ -66,6 +72,11 @@ Encore
// enables hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())
// enables @babel/preset-env polyfills
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
})
// enables Sass/SCSS support
//.enableSassLoader()