mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 10:51:30 +00:00
Compare commits
4 Commits
eslint/fix
...
exclude-ve
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6e4d1eaf9 | ||
|
|
2d3d96bcc7 | ||
|
|
f2d4cfcef9 | ||
|
|
9ea588261e |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"sourceMap": false,
|
||||
"sourceMap": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
|
||||
@@ -11,6 +11,7 @@ const childProcess = require("child_process");
|
||||
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
|
||||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
const isCI = require("is-ci");
|
||||
const webpack = require("webpack");
|
||||
|
||||
const gitSha = childProcess.execSync("git rev-parse HEAD").toString("utf8");
|
||||
|
||||
@@ -104,6 +105,15 @@ module.exports = function(env = {}, argv = {}) {
|
||||
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 = [
|
||||
new CleanWebpackPlugin(["dist"]),
|
||||
new CreateFileWebpack({
|
||||
@@ -164,7 +174,9 @@ module.exports = function(env = {}, argv = {}) {
|
||||
new CopyWebpackPlugin({
|
||||
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) {
|
||||
@@ -194,7 +206,6 @@ module.exports = function(env = {}, argv = {}) {
|
||||
filename: "[name].[chunkhash:6].js",
|
||||
path: path.resolve(__dirname, "dist")
|
||||
},
|
||||
devtool: mode === "development" ? "cheap-eval-source-map" : "source-map",
|
||||
plugins,
|
||||
module: {
|
||||
rules
|
||||
@@ -206,6 +217,7 @@ module.exports = function(env = {}, argv = {}) {
|
||||
minimize: mode === "production" ? true : false,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
sourceMap: true,
|
||||
cache: ".cache/terser",
|
||||
terserOptions: {
|
||||
// These options increase our initial bundle size by ~5% but the builds are significantly faster and won't run out of memory
|
||||
|
||||
Reference in New Issue
Block a user