Skip to content

Commit a9a6026

Browse files
authored
fix(rspack): refine nestjs example (#455)
1 parent 2dc38fc commit a9a6026

3 files changed

Lines changed: 6 additions & 9 deletions

File tree

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rspack/nestjs/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"license": "MIT",
66
"scripts": {
7-
"build": "cross-env BUILD=true rspack build",
7+
"build": "rspack build",
88
"dev": "rspack dev",
99
"start": "node dist/main.js"
1010
},
@@ -20,7 +20,6 @@
2020
"@rspack/cli": "2.0.2",
2121
"@rspack/core": "2.0.2",
2222
"@rspack/dev-server": "2.0.1",
23-
"cross-env": "10.1.0",
2423
"webpack-node-externals": "3.0.0"
2524
}
2625
}

rspack/nestjs/rspack.config.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import { rspack } from '@rspack/core';
44
import { RunScriptWebpackPlugin } from 'run-script-webpack-plugin';
55
import nodeExternals from 'webpack-node-externals';
66

7-
const isProduction = process.env.BUILD === 'true';
8-
97
export default defineConfig({
108
context: import.meta.dirname,
119
target: 'node',
1210
entry: {
13-
main: isProduction ? './src/main.ts' : ['@rspack/core/hot/poll?100', './src/main.ts'],
11+
main:
12+
process.env.NODE_ENV === 'production'
13+
? './src/main.ts'
14+
: ['@rspack/core/hot/poll?100', './src/main.ts'],
1415
},
1516
output: {
1617
clean: true,
@@ -61,7 +62,7 @@ export default defineConfig({
6162
},
6263
externalsType: 'commonjs',
6364
plugins: [
64-
!process.env.BUILD &&
65+
process.env.NODE_ENV !== 'production' &&
6566
new RunScriptWebpackPlugin({
6667
name: 'main.js',
6768
autoRestart: false,

0 commit comments

Comments
 (0)