Skip to content

Commit

Permalink
chore: set rspack build externalsPresets
Browse files Browse the repository at this point in the history
Update rspack.dev.config.js
Update rspack.config.js
  • Loading branch information
baranwang authored and VirgilClyne committed Jan 3, 2025
1 parent ce91018 commit a835d37
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 8 additions & 3 deletions rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@ 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",
},
optimization: {
minimize: false,
usedExports: true,
},
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 All @@ -36,5 +40,6 @@ export default defineConfig({
}),
],
devtool: false,
externalsPresets: { node: true },
performance: false,
});
8 changes: 5 additions & 3 deletions rspack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ 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",
},
optimization: {
minimize: false,
usedExports: true,
},
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 All @@ -39,5 +40,6 @@ export default defineConfig({
}),
],
devtool: false,
externalsPresets: { node: true },
performance: false,
});

0 comments on commit a835d37

Please sign in to comment.