mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-08 03:57:31 +00:00
Don't generate source maps for vendor files
This commit is contained in:
@@ -11,6 +11,7 @@ const childProcess = require("child_process");
|
|||||||
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
|
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
|
||||||
const TerserPlugin = require("terser-webpack-plugin");
|
const TerserPlugin = require("terser-webpack-plugin");
|
||||||
const isCI = require("is-ci");
|
const isCI = require("is-ci");
|
||||||
|
const webpack = require("webpack");
|
||||||
|
|
||||||
const gitSha = childProcess.execSync("git rev-parse HEAD").toString("utf8");
|
const gitSha = childProcess.execSync("git rev-parse HEAD").toString("utf8");
|
||||||
|
|
||||||
@@ -104,6 +105,14 @@ module.exports = function(env = {}, argv = {}) {
|
|||||||
envVars.NODE_ENV = "development";
|
envVars.NODE_ENV = "development";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sourceMapPlugin =
|
||||||
|
mode === "development"
|
||||||
|
? new webpack.EvalSourceMapDevToolPlugin({})
|
||||||
|
: new webpack.SourceMapDevToolPlugin({
|
||||||
|
filename: "[name].js.map",
|
||||||
|
exclude: [/vendor/]
|
||||||
|
});
|
||||||
|
|
||||||
const plugins = [
|
const plugins = [
|
||||||
new CleanWebpackPlugin(["dist"]),
|
new CleanWebpackPlugin(["dist"]),
|
||||||
new CreateFileWebpack({
|
new CreateFileWebpack({
|
||||||
@@ -164,7 +173,8 @@ module.exports = function(env = {}, argv = {}) {
|
|||||||
new CopyWebpackPlugin({
|
new CopyWebpackPlugin({
|
||||||
patterns: [{ from: "DataExplorer.nuspec" }, { from: "web.config" }, { from: "quickstart/*.zip" }]
|
patterns: [{ from: "DataExplorer.nuspec" }, { from: "web.config" }, { from: "quickstart/*.zip" }]
|
||||||
}),
|
}),
|
||||||
new EnvironmentPlugin(envVars)
|
new EnvironmentPlugin(envVars),
|
||||||
|
sourceMapPlugin
|
||||||
];
|
];
|
||||||
|
|
||||||
if (argv.analyze) {
|
if (argv.analyze) {
|
||||||
@@ -194,7 +204,7 @@ module.exports = function(env = {}, argv = {}) {
|
|||||||
filename: "[name].[chunkhash:6].js",
|
filename: "[name].[chunkhash:6].js",
|
||||||
path: path.resolve(__dirname, "dist")
|
path: path.resolve(__dirname, "dist")
|
||||||
},
|
},
|
||||||
devtool: mode === "development" ? "cheap-eval-source-map" : "source-map",
|
devtool: false,
|
||||||
plugins,
|
plugins,
|
||||||
module: {
|
module: {
|
||||||
rules
|
rules
|
||||||
|
|||||||
Reference in New Issue
Block a user