43 lines
1.4 KiB
JavaScript
43 lines
1.4 KiB
JavaScript
const Encore = require('@symfony/webpack-encore');
|
|
|
|
if (!Encore.isRuntimeEnvironmentConfigured()) {
|
|
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
|
|
}
|
|
|
|
Encore
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// PATHS
|
|
// ----------------------------------------------------------------------------
|
|
|
|
.setOutputPath('public/build/')
|
|
.setPublicPath('/build')
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// ENTRIES
|
|
// ----------------------------------------------------------------------------
|
|
|
|
.addEntry('app', './assets/js/app.js')
|
|
.addStyleEntry('main', './assets/css/main.scss')
|
|
.addStyleEntry('panel', './assets/css/panel.scss')
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// FEATURES
|
|
// ----------------------------------------------------------------------------
|
|
|
|
.disableSingleRuntimeChunk()
|
|
.cleanupOutputBeforeBuild()
|
|
.enableBuildNotifications()
|
|
.enableSourceMaps(!Encore.isProduction())
|
|
.configureBabel((config) => {
|
|
config.plugins.push('@babel/plugin-proposal-class-properties');
|
|
})
|
|
.configureBabelPresetEnv((config) => {
|
|
config.useBuiltIns = 'usage';
|
|
config.corejs = 3;
|
|
})
|
|
.enableSassLoader()
|
|
.enablePostCssLoader()
|
|
;
|
|
|
|
module.exports = Encore.getWebpackConfig();
|