From 96a4e34116cb034314e6580025181abd0222057c Mon Sep 17 00:00:00 2001 From: Kristoffer K Date: Wed, 4 Jan 2023 13:14:32 +0100 Subject: [PATCH] build: enable production mode (#224) --- mkshims.ts | 2 +- package.json | 1 - webpack.config.js | 10 +++------- yarn.lock | 3 +-- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/mkshims.ts b/mkshims.ts index bac683ab3..e2e0defc7 100644 --- a/mkshims.ts +++ b/mkshims.ts @@ -6,7 +6,7 @@ import {Engine} from './sources/Engine'; import {SupportedPackageManagerSet} from './sources/types'; function shouldGenerateShim(name: string) { - return !name.startsWith(`vendors`); + return name !== `chunks`; } const engine = new Engine(); diff --git a/package.json b/package.json index 3d7218276..59ba168dd 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "semver": "^7.1.3", "supports-color": "^9.0.0", "tar": "^6.0.1", - "terser-webpack-plugin": "^5.1.2", "ts-loader": "^9.0.0", "ts-node": "^10.0.0", "typescript": "^4.3.2", diff --git a/webpack.config.js b/webpack.config.js index 16fb05e67..4d281a48b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,8 +1,7 @@ -const TerserPlugin = require(`terser-webpack-plugin`); const webpack = require(`webpack`); module.exports = { - mode: `development`, + mode: `production`, devtool: false, target: `node`, entry: { @@ -10,6 +9,7 @@ module.exports = { }, output: { libraryTarget: `commonjs`, + chunkFilename: `chunks/[name].cjs`, }, resolve: { extensions: [`.ts`, `.js`], @@ -33,11 +33,7 @@ module.exports = { assetsSort: `!size`, }, optimization: { - minimizer: [ - new TerserPlugin({ - extractComments: false, - }), - ], + minimize: false, }, plugins: [ new webpack.BannerPlugin({ diff --git a/yarn.lock b/yarn.lock index 505b8ae8f..787f156fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2279,7 +2279,6 @@ __metadata: semver: "npm:^7.1.3" supports-color: "npm:^9.0.0" tar: "npm:^6.0.1" - terser-webpack-plugin: "npm:^5.1.2" ts-loader: "npm:^9.0.0" ts-node: "npm:^10.0.0" typescript: "npm:^4.3.2" @@ -5756,7 +5755,7 @@ __metadata: languageName: node linkType: hard -"terser-webpack-plugin@npm:^5.1.2, terser-webpack-plugin@npm:^5.1.3": +"terser-webpack-plugin@npm:^5.1.3": version: 5.3.6 resolution: "terser-webpack-plugin@npm:5.3.6" dependencies: