og-image/webpack.config.js
Simon Vieille ace8a0d891
Init
2023-01-30 09:01:16 +01:00

40 lines
1.2 KiB
JavaScript

const Encore = require('@symfony/webpack-encore')
const HtmlWebpackPlugin = require('html-webpack-plugin')
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev')
Encore
// directory where compiled assets will be stored
.setOutputPath('public/')
.setPublicPath('/')
.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].[hash:8].[ext]'
})
.addPlugin(new HtmlWebpackPlugin({
template: 'src/index.html',
}))
.enableSassLoader()
.enableVersioning()
.enablePostCssLoader()
;
module.exports = Encore.getWebpackConfig()