Files
tabby-web/webpack.config.js

34 lines
915 B
JavaScript
Raw Normal View History

2021-07-24 20:38:07 +02:00
const baseConfig = require('./webpack.base.config.js')
2021-06-25 21:55:40 +02:00
const path = require('path')
const { AngularWebpackPlugin } = require('@ngtools/webpack')
2021-07-24 20:25:09 +02:00
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
2021-07-24 20:38:07 +02:00
module.exports = {
2021-07-24 20:25:09 +02:00
name: 'browser',
target: 'web',
...baseConfig,
entry: {
2021-07-24 20:38:07 +02:00
index: path.resolve(__dirname, 'src/index.ts'),
terminal: path.resolve(__dirname, 'src/terminal.ts'),
2021-07-24 20:25:09 +02:00
},
plugins: [
2021-07-24 20:38:07 +02:00
...baseConfig.plugins,
new AngularWebpackPlugin({
2021-07-24 20:25:09 +02:00
tsconfig: 'tsconfig.json',
directTemplateLoading: false,
skipCodeGeneration: false,
2021-07-24 20:38:07 +02:00
}),
2021-07-24 20:25:09 +02:00
],
output: {
2021-07-24 20:38:07 +02:00
path: path.join(__dirname, 'build'),
pathinfo: true,
publicPath: '/static/',
filename: '[name].js',
chunkFilename: '[name].bundle.js',
2021-07-24 20:25:09 +02:00
},
2021-07-24 20:38:07 +02:00
}
2021-07-24 20:25:09 +02:00
if (process.env.BUNDLE_ANALYZER) {
2021-07-24 20:38:07 +02:00
module.exports[0].plugins.push(new BundleAnalyzerPlugin())
2021-07-24 20:25:09 +02:00
}