mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-07-07 02:11:25 +02:00
HMR support for panel development
This commit is contained in:
@@ -56,78 +56,21 @@ const config = [
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: 'static',
|
||||
reportFilename: "extension.html",
|
||||
openAnalyzer: false
|
||||
})
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'panelWebView',
|
||||
target: 'web',
|
||||
entry: './src/panelWebView/index.tsx',
|
||||
output: {
|
||||
filename: 'panelWebView.js',
|
||||
path: path.resolve(__dirname, '../dist')
|
||||
},
|
||||
devtool: 'source-map',
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js', '.tsx', '.jsx']
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(ts|tsx)$/,
|
||||
exclude: /node_modules/,
|
||||
use: [{
|
||||
loader: 'ts-loader'
|
||||
}]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ['style-loader', 'css-loader']
|
||||
},
|
||||
{
|
||||
test: /\.m?js/,
|
||||
resolve: {
|
||||
fullySpecified: false
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
performance: {
|
||||
maxEntrypointSize: 400000,
|
||||
maxAssetSize: 400000
|
||||
},
|
||||
// optimization: {
|
||||
// splitChunks: {
|
||||
// cacheGroups: {
|
||||
// vendors: {
|
||||
// test: /node_modules/,
|
||||
// chunks: 'initial',
|
||||
// filename: 'vendors.[contenthash].js',
|
||||
// priority: 1,
|
||||
// maxInitialRequests: 2, // create only one vendor file
|
||||
// minChunks: 1,
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
plugins: [
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: 'static',
|
||||
reportFilename: "viewpanel.html",
|
||||
openAnalyzer: false
|
||||
})
|
||||
]
|
||||
plugins: []
|
||||
}
|
||||
];
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
for (const configItem of config) {
|
||||
configItem.mode = argv.mode;
|
||||
|
||||
if (argv.mode === 'production') {
|
||||
configItem.plugins.push(new BundleAnalyzerPlugin({
|
||||
analyzerMode: 'static',
|
||||
reportFilename: "extension.html",
|
||||
openAnalyzer: false
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
|
||||
Reference in New Issue
Block a user