Skip to content

Commit

Permalink
chore: set rspack build target
Browse files Browse the repository at this point in the history
  • Loading branch information
baranwang authored and VirgilClyne committed Jan 2, 2025
1 parent ce91018 commit 40d46c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ import pkg from "./package.json" with { type: "json" };

export default defineConfig({
entry: {
"request": "./src/request.js",
"response": "./src/response.js",
request: "./src/request.js",
response: "./src/response.js",
},
output: {
filename: "[name].bundle.js",
},
target: "node",
plugins: [
new NodePolyfillPlugin({
//additionalAliases: ['console'],
}),
new rspack.BannerPlugin({
banner: `console.log('Date: ${new Date().toLocaleString('zh-CN', {timeZone: 'PRC'})}');`,
banner: `console.log('Date: ${new Date().toLocaleString("zh-CN", { timeZone: "PRC" })}');`,
raw: true,
}),
new rspack.BannerPlugin({
Expand Down
7 changes: 4 additions & 3 deletions rspack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import pkg from "./package.json" with { type: "json" };

export default defineConfig({
entry: {
"request": "./src/request.dev.js",
"response": "./src/response.dev.js",
request: "./src/request.dev.js",
response: "./src/response.dev.js",
},
output: {
filename: "[name].bundle.js",
},
target: "node",
optimization: {
minimize: false,
},
Expand All @@ -19,7 +20,7 @@ export default defineConfig({
//additionalAliases: ['console'],
}),
new rspack.BannerPlugin({
banner: `console.log('Date: ${new Date().toLocaleString('zh-CN', {timeZone: 'PRC'})}');`,
banner: `console.log('Date: ${new Date().toLocaleString("zh-CN", { timeZone: "PRC" })}');`,
raw: true,
}),
new rspack.BannerPlugin({
Expand Down

0 comments on commit 40d46c2

Please sign in to comment.