forked from deblan/side_menu
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
const Encore = require('@symfony/webpack-encore');
|
|
|
|
// 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
|
|
.setOutputPath('assets/')
|
|
.setPublicPath('./')
|
|
.addEntry('admin', './src/admin.js')
|
|
.addEntry('menu', './src/menu.js')
|
|
.setManifestKeyPrefix('./')
|
|
.enableSingleRuntimeChunk()
|
|
.cleanupOutputBeforeBuild()
|
|
.enableVueLoader()
|
|
.enableSourceMaps(!Encore.isProduction())
|
|
.enableVersioning(Encore.isProduction())
|
|
.configureBabel((config) => {
|
|
config.plugins.push('@babel/plugin-proposal-class-properties');
|
|
})
|
|
.configureBabelPresetEnv((config) => {
|
|
config.useBuiltIns = 'usage';
|
|
config.corejs = 3;
|
|
})
|
|
.copyFiles({
|
|
from: './img',
|
|
to: 'images/[path][name].[hash:8].[ext]'
|
|
})
|
|
.enableSassLoader()
|
|
;
|
|
|
|
module.exports = Encore.getWebpackConfig();
|