Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 0137e4e

Browse files
committed
update webpack mode to production
1 parent 821ef19 commit 0137e4e

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

gulpfile.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ const fs = require("fs");
1111
const fsp = require('fs-plus');
1212
const path = require("path");
1313
const childProcess = require("child_process");
14+
const argv = require('minimist')(process.argv.slice(2));
1415

1516
//...
1617
gulp.task("tslint", () => {
1718
return gulp.src(["**/*.ts", "**/*.tsx", "!**/*.d.ts", "!node_modules/**", "!./src/views/node_modules/**"])
18-
.pipe(tslint())
19-
.pipe(tslint.report());
19+
.pipe(tslint())
20+
.pipe(tslint.report());
2021
});
2122

2223
gulp.task("eslint", () => {
@@ -29,6 +30,7 @@ gulp.task("eslint", () => {
2930
gulp.task("html-webpack", (done) => {
3031
const config = require("./src/views/webpack.config.js");
3132
config.context = `${__dirname}/src/views`;
33+
config.mode = argv.mode ? argv.mode : 'production';
3234
return webpack(config, (err, stats) => {
3335
const statsJson = stats.toJson();
3436
if (err || (statsJson.errors && statsJson.errors.length)) {
@@ -46,6 +48,7 @@ gulp.task("html-webpack", (done) => {
4648
gulp.task("node_modules-webpack", (done) => {
4749
const config = require("./webpack.config.js");
4850
config.context = `${__dirname}`;
51+
config.mode = argv.mode ? argv.mode : 'production';
4952
return webpack(config, (err, stats) => {
5053
const statsJson = stats.toJson();
5154
if (err || (statsJson.errors && statsJson.errors.length)) {

package-lock.json

+11-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@
534534
]
535535
},
536536
"scripts": {
537-
"vscode:prepublish": "gulp build",
537+
"vscode:prepublish": "gulp build --mode=production",
538538
"postinstall": "node ./node_modules/vscode/bin/install && cd ./src/views && npm install",
539539
"test": "gulp test"
540540
},
@@ -560,6 +560,7 @@
560560
"gulp-sourcemaps": "^2.4.1",
561561
"gulp-tslint": "^8.1.4",
562562
"gulp-typescript": "^5.0.1",
563+
"minimist": "^1.2.0",
563564
"mocha": "^6.2.2",
564565
"plugin-error": "^1.0.1",
565566
"tslint": "^5.20.1",

src/views/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
55

66
module.exports = {
77
devtool: "source-map",
8-
mode: "development",
8+
99
entry: [
1010
`${__dirname}/app/index.tsx`
1111
],

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function getDependeciesFromNpm(mod) {
4545
/**@type {import('webpack').Configuration}*/
4646
const config = {
4747
target: 'node',
48-
mode: "development",
48+
4949
entry: getEntry(),
5050
output: {
5151
path: path.resolve(__dirname, 'out/node_modules'),

0 commit comments

Comments
 (0)