chore: upgrade to webpack encore 7

This commit is contained in:
fromme committed 2026-10-20 10:06:35 +02:00
1 parent 32083c7966
commit 3428408db5
5 files changed
+1241 -2191

No files matched your search

+1
View File
@@ -0,0 +1 @@
defaults
+2 -1
View File
@@ -40,6 +40,7 @@ $rsyncOptions = [
'.env.dev.local.php', '.env.dev.local.php',
'.env.test', '.env.test',
'.env.test.local', '.env.test.local',
'.browserslistrc',
'.gitignore', '.gitignore',
'.nvmrc', '.nvmrc',
'.php-cs-fixer.cache', '.php-cs-fixer.cache',
@@ -59,7 +60,7 @@ $rsyncOptions = [
'public/.htaccess', 'public/.htaccess',
'ray.php', 'ray.php',
'tailwind.config.js', 'tailwind.config.js',
'webpack.config.js', 'webpack.config.mjs',
'bin/.phpunit', 'bin/.phpunit',
'temp/', 'temp/',
'tests/', 'tests/',
+1223 -2179
View File
File diff suppressed because it is too large. Load diff
+6 -6
View File
@@ -1,26 +1,26 @@
{ {
"name": "myep", "name": "myep",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.17.0", "@babel/core": "^8.0.7",
"@babel/preset-env": "^7.16.0", "@babel/preset-env": "^8.0.7",
"@hotwired/stimulus": "^3.0.0", "@hotwired/stimulus": "^3.0.0",
"@symfony/stimulus-bridge": "^3.2.0", "@symfony/stimulus-bridge": "^3.2.0",
"@symfony/webpack-encore": "^6.0.0", "@symfony/webpack-encore": "^7.2.0",
"@tailwindcss/forms": "^0.5.9", "@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15", "@tailwindcss/typography": "^0.5.15",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"babel-plugin-polyfill-corejs3": "^1.0.0",
"core-js": "^3.38.0", "core-js": "^3.38.0",
"cypress": "^15.5.0", "cypress": "^15.5.0",
"file-loader": "^6.2.0",
"htmx.org": "^1.9.12", "htmx.org": "^1.9.12",
"lightningcss": "^1.33.0",
"postcss": "^8.4.49", "postcss": "^8.4.49",
"postcss-loader": "^8.1.1", "postcss-loader": "^8.1.1",
"regenerator-runtime": "^0.13.9",
"tailwindcss": "^3.4.15", "tailwindcss": "^3.4.15",
"tippy.js": "^6.3.7", "tippy.js": "^6.3.7",
"toastify-js": "^1.12.0", "toastify-js": "^1.12.0",
"webpack": "^5.74.0", "webpack": "^5.74.0",
"webpack-cli": "^6.0.1" "webpack-cli": "^7.2.3"
}, },
"license": "WTFPL", "license": "WTFPL",
"private": true, "private": true,
+9 -5
View File
@@ -1,4 +1,4 @@
const Encore = require('@symfony/webpack-encore'); import Encore from '@symfony/webpack-encore';
if (!Encore.isRuntimeEnvironmentConfigured()) { if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev'); Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
@@ -17,9 +17,13 @@ Encore
.cleanupOutputBeforeBuild() .cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction()) .enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction()) .enableVersioning(Encore.isProduction())
.configureBabelPresetEnv((config) => { // Babel 8 dropped preset-env's useBuiltIns/corejs; polyfill-corejs3 is its replacement
config.useBuiltIns = 'usage'; .configureBabel((babelConfig) => {
config.corejs = '3.23'; 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() .enablePostCssLoader()
.copyFiles([ .copyFiles([
@@ -30,4 +34,4 @@ Encore
]) ])
; ;
module.exports = Encore.getWebpackConfig(); export default await Encore.getWebpackConfig();