Skip to content

Commit fb76dbf

Browse files
dev: validate webpack mode input (#1831)
1 parent a062acd commit fb76dbf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dev/src/gulp/gulp_webpack.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ import * as cp from 'child_process';
77
import * as path from 'path';
88
import * as process from 'process';
99

10-
export function gulp_webpack(mode: string): cp.ChildProcess {
10+
export function gulp_webpack(mode: 'development' | 'production'): cp.ChildProcess {
11+
12+
if (mode !== 'development' && mode !== 'production') {
13+
throw new Error('Invalid mode. Must be either "development" or "production"');
14+
}
15+
1116
const env: {
1217
[key: string]: string | undefined;
1318
} = process.env;

0 commit comments

Comments
 (0)