Compare commits

...

4 Commits

Author SHA1 Message Date
Steve Faulkner
a6e4d1eaf9 Remove default 2020-09-25 18:13:11 -05:00
Steve Faulkner
2d3d96bcc7 xMerge branch 'master' into exclude-vendor-from-sourcemaps 2020-09-25 18:12:17 -05:00
Steve Faulkner
f2d4cfcef9 Fixes 2020-09-25 18:12:04 -05:00
Steve Faulkner
9ea588261e Don't generate source maps for vendor files 2020-09-25 14:46:51 -05:00
2 changed files with 15 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
{ {
"compilerOptions": { "compilerOptions": {
"allowJs": true, "allowJs": true,
"sourceMap": false, "sourceMap": true,
"noImplicitAny": true, "noImplicitAny": true,
"noImplicitReturns": true, "noImplicitReturns": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,

View File

@@ -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,15 @@ module.exports = function(env = {}, argv = {}) {
envVars.NODE_ENV = "development"; envVars.NODE_ENV = "development";
} }
const sourceMapPlugin =
mode === "development"
? new webpack.EvalSourceMapDevToolPlugin({})
: new webpack.SourceMapDevToolPlugin({
// test: [".js", ".mjs", ".css", ".ts", ".tsx"],
filename: "[name].js.map",
exclude: [/vendor/]
});
const plugins = [ const plugins = [
new CleanWebpackPlugin(["dist"]), new CleanWebpackPlugin(["dist"]),
new CreateFileWebpack({ new CreateFileWebpack({
@@ -164,7 +174,9 @@ 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),
new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }),
sourceMapPlugin
]; ];
if (argv.analyze) { if (argv.analyze) {
@@ -194,7 +206,6 @@ 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",
plugins, plugins,
module: { module: {
rules rules
@@ -206,6 +217,7 @@ module.exports = function(env = {}, argv = {}) {
minimize: mode === "production" ? true : false, minimize: mode === "production" ? true : false,
minimizer: [ minimizer: [
new TerserPlugin({ new TerserPlugin({
sourceMap: true,
cache: ".cache/terser", cache: ".cache/terser",
terserOptions: { terserOptions: {
// These options increase our initial bundle size by ~5% but the builds are significantly faster and won't run out of memory // These options increase our initial bundle size by ~5% but the builds are significantly faster and won't run out of memory