chore: upgrade to webpack encore 7
This commit is contained in:
1 parent
32083c7966
commit
3428408db5
5 files changed
+1241
-2191
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import Encore from '@symfony/webpack-encore';
|
||||
|
||||
if (!Encore.isRuntimeEnvironmentConfigured()) {
|
||||
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
|
||||
}
|
||||
|
||||
Encore
|
||||
.setOutputPath('public/build/')
|
||||
.setPublicPath('/build')
|
||||
.addEntry('app', './assets/app.js')
|
||||
.addEntry('admin', './assets/admin.js')
|
||||
.splitEntryChunks()
|
||||
|
||||
// enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)
|
||||
.enableStimulusBridge('./assets/controllers.json')
|
||||
.enableSingleRuntimeChunk()
|
||||
.cleanupOutputBeforeBuild()
|
||||
.enableSourceMaps(!Encore.isProduction())
|
||||
.enableVersioning(Encore.isProduction())
|
||||
// Babel 8 dropped preset-env's useBuiltIns/corejs; polyfill-corejs3 is its replacement
|
||||
.configureBabel((babelConfig) => {
|
||||
babelConfig.plugins.push(['polyfill-corejs3', {method: 'usage-global', version: '3.23'}]);
|
||||
})
|
||||
// Encore 7 ships no CSS minifier of its own
|
||||
.configureCssMinimizerPlugin((options, MinimizerPlugin) => {
|
||||
options.minify = MinimizerPlugin.lightningCssMinify;
|
||||
})
|
||||
.enablePostCssLoader()
|
||||
.copyFiles([
|
||||
{from: './assets/images', to: 'images/[path][name].[hash:8].[ext]'},
|
||||
{from: './assets/favicon', to: 'favicon/[path][name].[hash:8].[ext]'},
|
||||
// voucher thumbnails
|
||||
{from: './assets/vouchers', to: 'images/vouchers/[path][name].[hash:8].[ext]', pattern: /\.jpg$/},
|
||||
])
|
||||
;
|
||||
|
||||
export default await Encore.getWebpackConfig();
|
||||
Reference in new issue
Block a user