Files
wallabag-mirror/webpack.config.js
Jeremy Benoist f2b7d21d8b Migrate from v3 to v4
Also copy file for SRE otherwise the request is not found.
Rendering validated with http://math.rgug.ch/2013/03/08/matrices-complementaires-et-produits/
2026-04-22 14:15:34 +02:00

42 lines
1.3 KiB
JavaScript

const path = require('path');
const Encore = require('@symfony/webpack-encore');
const { codecovWebpackPlugin } = require('@codecov/webpack-plugin');
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
.setOutputPath('web/build/')
.setPublicPath('/build')
.addEntry('main', './assets/index.js')
.addEntry('public', './assets/share.js')
.splitEntryChunks()
.enableStimulusBridge('./assets/controllers.json')
.enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.configureBabelPresetEnv((config) => {
config.modules = false;
config.useBuiltIns = 'usage';
config.corejs = '3.23';
})
.enableSassLoader()
.enablePostCssLoader()
.copyFiles({
from: './node_modules/mathjax/sre',
to: 'sre/[path][name].[ext]',
})
.addAliases({
module$: path.resolve(__dirname, 'assets/vendor/node_module_browser_stub.js'),
})
.addPlugin(codecovWebpackPlugin({
enableBundleAnalysis: typeof process.env.CODECOV_TOKEN !== 'undefined',
bundleName: 'wallabag',
uploadToken: process.env.CODECOV_TOKEN,
}));
module.exports = Encore.getWebpackConfig();