Add duplicate-package-checker-webpack-plugin (#9517)
We are duplicating semver. It's such a small package that I don't think that it is worth spending much time trying to understand why.
This commit is contained in:
@@ -17,9 +17,9 @@ const chalk = require("chalk");
|
||||
const through = require("through2");
|
||||
const fancyLog = require("fancy-log");
|
||||
const rename = require("gulp-rename");
|
||||
const RootMostResolvePlugin = require("webpack-dependency-suite")
|
||||
.RootMostResolvePlugin;
|
||||
const webpack = require("webpack");
|
||||
const { RootMostResolvePlugin } = require("webpack-dependency-suite");
|
||||
const DuplicatePackageCheckerPlugin = require("duplicate-package-checker-webpack-plugin");
|
||||
const webpackStream = require("webpack-stream");
|
||||
const uglify = require("gulp-uglify");
|
||||
|
||||
@@ -62,6 +62,11 @@ function webpackBuild(opts) {
|
||||
libraryTarget: "umd",
|
||||
},
|
||||
plugins: [
|
||||
new DuplicatePackageCheckerPlugin({
|
||||
exclude(instance) {
|
||||
return instance.name === "semver";
|
||||
},
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
"process.env.NODE_ENV": '"production"',
|
||||
"process.env": JSON.stringify({ NODE_ENV: "production" }),
|
||||
@@ -92,8 +97,11 @@ function webpackBuild(opts) {
|
||||
return webpackStream(config, webpack);
|
||||
// To write JSON for debugging:
|
||||
/*return webpackStream(config, webpack, (err, stats) => {
|
||||
require('fancy-log')(stats.toString({colors: true}));
|
||||
require('fs').writeFileSync('webpack-debug.json', JSON.stringify(stats.toJson()));
|
||||
require("fancy-log")(stats.toString({ colors: true }));
|
||||
require("fs").writeFileSync(
|
||||
"webpack-debug.json",
|
||||
JSON.stringify(stats.toJson())
|
||||
);
|
||||
});*/
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user