mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 07:38:01 +08:00
e52b769ceb
* Add option to build with webpack bundle analyzer * Bump npm to v7 as recommended in actions/setup-node#213 * Workaround for npm/cli#558 * Add missing dep
28 lines
654 B
JavaScript
Executable File
28 lines
654 B
JavaScript
Executable File
const config = require('flarum-webpack-config');
|
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
const merge = require('webpack-merge');
|
|
|
|
const useBundleAnalyzer = process.env.ANALYZER === 'true';
|
|
|
|
const plugins = [];
|
|
|
|
if (useBundleAnalyzer) {
|
|
plugins.push(new BundleAnalyzerPlugin());
|
|
}
|
|
|
|
module.exports = merge(config(), {
|
|
output: {
|
|
library: 'flarum.core',
|
|
},
|
|
|
|
// temporary TS configuration
|
|
resolve: {
|
|
extensions: ['.ts', '.tsx', '.js', '.json'],
|
|
},
|
|
|
|
plugins,
|
|
});
|
|
|
|
module.exports['module'].rules[0].test = /\.(tsx?|js)$/;
|
|
module.exports['module'].rules[0].use.options.presets.push('@babel/preset-typescript');
|