42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
const Encore = require('@symfony/webpack-encore')
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
const APP_BASE_URL = '/'
|
|
|
|
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev')
|
|
|
|
Encore
|
|
.setOutputPath('public/')
|
|
.setPublicPath(APP_BASE_URL)
|
|
.setManifestKeyPrefix('')
|
|
.addEntry('app', './src/app.js')
|
|
.enableSingleRuntimeChunk()
|
|
.cleanupOutputBeforeBuild()
|
|
.enableBuildNotifications()
|
|
.enableSourceMaps(!Encore.isProduction())
|
|
.enableVersioning(Encore.isProduction())
|
|
.enableVueLoader(() => {}, { runtimeCompilerBuild: false })
|
|
.configureBabel((config) => {
|
|
config.plugins.push('@babel/plugin-proposal-class-properties')
|
|
})
|
|
.configureTerserPlugin((config) => {
|
|
config.parallel = TERSER_PARALLEL
|
|
})
|
|
.configureBabelPresetEnv((config) => {
|
|
config.useBuiltIns = 'usage'
|
|
config.corejs = 3
|
|
})
|
|
.copyFiles({
|
|
from: './src/img',
|
|
to: 'img/[path][name].[ext]'
|
|
})
|
|
.addPlugin(new HtmlWebpackPlugin({
|
|
template: 'src/index.html',
|
|
favicon: 'src/img/favicon.svg'
|
|
}))
|
|
.enableSassLoader()
|
|
.enableVersioning()
|
|
.enablePostCssLoader()
|
|
;
|
|
|
|
module.exports = Encore.getWebpackConfig()
|