mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-03-28 17:42:40 +01:00
webpack update + loading prod files
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
//@ts-check
|
||||
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
@@ -7,13 +5,15 @@ const {
|
||||
ProvidePlugin
|
||||
} = require('webpack');
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
const WebpackManifestPlugin = require('webpack-manifest-plugin').WebpackManifestPlugin;
|
||||
|
||||
const config = [{
|
||||
name: 'dashboard',
|
||||
target: 'web',
|
||||
entry: './src/dashboardWebView/index.tsx',
|
||||
output: {
|
||||
filename: 'dashboardWebView.js',
|
||||
filename: 'dashboard.[name].js',
|
||||
chunkFilename: '[name].[contenthash].js',
|
||||
path: path.resolve(__dirname, '../dist')
|
||||
},
|
||||
devtool: 'source-map',
|
||||
@@ -81,6 +81,17 @@ module.exports = (env, argv) => {
|
||||
reportFilename: "dashboard.html",
|
||||
openAnalyzer: false
|
||||
}));
|
||||
|
||||
configItem.plugins.push(new WebpackManifestPlugin({
|
||||
publicPath: "",
|
||||
fileName: "dashboard.manifest.json"
|
||||
}));
|
||||
|
||||
configItem.optimization = {
|
||||
splitChunks: {
|
||||
chunks: 'all',
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
//@ts-check
|
||||
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
const WebpackManifestPlugin = require('webpack-manifest-plugin').WebpackManifestPlugin;
|
||||
|
||||
const config = [{
|
||||
name: 'panel',
|
||||
target: 'web',
|
||||
entry: './src/panelWebView/index.tsx',
|
||||
output: {
|
||||
filename: 'panelWebView.js',
|
||||
filename: 'panel.[name].js',
|
||||
chunkFilename: '[name].[contenthash].js',
|
||||
path: path.resolve(__dirname, '../dist')
|
||||
},
|
||||
devtool: 'source-map',
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js', '.tsx', '.jsx'],
|
||||
fallback: {
|
||||
fallback: {
|
||||
"path": require.resolve("path-browserify")
|
||||
}
|
||||
},
|
||||
@@ -73,7 +73,7 @@ const config = [{
|
||||
if (error.message === "ResizeObserver loop limit exceeded") {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -87,12 +87,23 @@ module.exports = (env, argv) => {
|
||||
|
||||
if (argv.mode === 'production') {
|
||||
configItem.devtool = "hidden-source-map";
|
||||
|
||||
|
||||
configItem.plugins.push(new BundleAnalyzerPlugin({
|
||||
analyzerMode: 'static',
|
||||
reportFilename: "viewpanel.html",
|
||||
openAnalyzer: false
|
||||
}));
|
||||
|
||||
configItem.plugins.push(new WebpackManifestPlugin({
|
||||
publicPath: "",
|
||||
fileName: "panel.manifest.json"
|
||||
}));
|
||||
|
||||
configItem.optimization = {
|
||||
splitChunks: {
|
||||
chunks: 'all',
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user