Skip to content

Commit

Permalink
fix(create-rspack): remove useless sourceMap option in templates (#6319)
Browse files Browse the repository at this point in the history
* fix(create-rspack): remove useless sourceMap option

* docs: remove sourceMaps: true
  • Loading branch information
chenjiahan authored Apr 23, 2024
1 parent 81c41c8 commit 6f80f58
Show file tree
Hide file tree
Showing 22 changed files with 11 additions and 42 deletions.
4 changes: 2 additions & 2 deletions diffcases/arco-pro/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const config = {
exclude: [/[\\/]node_modules[\\/]/],
loader: "builtin:swc-loader",
options: {
sourceMap: false,
sourceMaps: false,
jsc: {
parser: {
syntax: "typescript"
Expand All @@ -53,7 +53,7 @@ const config = {
loader: "builtin:swc-loader",
exclude: [/[\\/]node_modules[\\/]/],
options: {
sourceMap: false,
sourceMaps: false,
jsc: {
parser: {
syntax: "typescript",
Expand Down
14 changes: 7 additions & 7 deletions diffcases/arco-pro/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");

/** @type {import('webpack').Configuration} */
const config = {
mode: 'production',
mode: "production",
context: __dirname,
entry: "./src/index.tsx",
target: ["web", "es5"],
Expand All @@ -13,7 +13,7 @@ const config = {
test: /\.less$/,
use: "less-loader",
parser: {
namedExports: false,
namedExports: false
},
generator: {
exportsOnly: true
Expand All @@ -40,7 +40,7 @@ const config = {
exclude: [/[\\/]node_modules[\\/]/],
loader: "swc-loader",
options: {
sourceMap: false,
sourceMaps: false,
jsc: {
parser: {
syntax: "typescript"
Expand All @@ -57,7 +57,7 @@ const config = {
loader: "swc-loader",
exclude: [/[\\/]node_modules[\\/]/],
options: {
sourceMap: false,
sourceMaps: false,
jsc: {
parser: {
syntax: "typescript",
Expand Down Expand Up @@ -90,7 +90,7 @@ const config = {
// expression, which causes stack overflow for swc parser in debug mode.
// Alias to the unminified version mitigates this problem.
// See also <https://github.com/search?q=repo%3Aswc-project%2Fswc+parser+stack+overflow&type=issues>
mockjs: require.resolve("./patches/mock.js"),
mockjs: require.resolve("./patches/mock.js")
},
extensions: [".js", ".jsx", ".ts", ".tsx", ".css", ".less"]
},
Expand Down Expand Up @@ -127,10 +127,10 @@ const config = {
title: "Arco Pro App",
template: path.join(__dirname, "index.html"),
favicon: path.join(__dirname, "public", "favicon.ico")
}),
})
],
infrastructureLogging: {
debug: false
},
}
};
module.exports = config;
1 change: 0 additions & 1 deletion packages/create-rspack/template-react-ts/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = {
{
loader: "builtin:swc-loader",
options: {
sourceMap: true,
jsc: {
parser: {
syntax: "typescript",
Expand Down
1 change: 0 additions & 1 deletion packages/create-rspack/template-react/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = {
{
loader: "builtin:swc-loader",
options: {
sourceMap: true,
jsc: {
parser: {
syntax: "typescript",
Expand Down
1 change: 0 additions & 1 deletion packages/create-rspack/template-vue/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const config = {
{
loader: "builtin:swc-loader",
options: {
sourceMap: true,
jsc: {
parser: {
syntax: "typescript",
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack-test-tools/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
exclude: [/[\\/]node_modules[\\/]/],
loader: "builtin:swc-loader",
options: {
sourceMap: false,
sourceMaps: false,
jsc: {
parser: {
syntax: "typescript"
Expand All @@ -42,7 +42,7 @@ module.exports = {
loader: "builtin:swc-loader",
exclude: [/[\\/]node_modules[\\/]/],
options: {
sourceMap: false,
sourceMaps: false,
jsc: {
parser: {
syntax: "typescript",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ module.exports = {
{
loader: "builtin:swc-loader",
options: {
// Enable source map
sourceMap: true,
jsc: {
parser: {
syntax: "typescript",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
test: /\.jsx$/,
loader: "builtin:swc-loader",
options: {
sourceMap: true,
jsc: {
parser: {
syntax: "ecmascript",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
test: /\.jsx$/,
loader: "builtin:swc-loader",
options: {
sourceMap: true,
jsc: {
parser: {
syntax: "ecmascript",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module.exports = {
use: {
loader: "builtin:swc-loader",
options: {
sourceMap: true,
jsc: {
parser: {
syntax: "typescript",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ module.exports = {
use: {
loader: "builtin:swc-loader",
options: {
// Enable source map
sourceMap: true,
jsc: {
parser: {
syntax: "typescript",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = {
test: /\.jsx$/,
loader: "builtin:swc-loader",
options: {
sourceMap: true,
jsc: {
parser: {
syntax: "ecmascript",
Expand Down
2 changes: 0 additions & 2 deletions website/docs/en/blog/announcing-0.3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ const config = {
use: {
loader: 'builtin:swc-loader',
options: {
// Enable source map
sourceMap: true,
jsc: {
parser: {
syntax: 'ecmascript',
Expand Down
3 changes: 0 additions & 3 deletions website/docs/en/blog/announcing-0.5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ module.exports = {
exclude: /[\\/]node_modules[\\/]/,
loader: 'builtin:swc-loader',
options: {
sourceMaps: true,
jsc: {
parser: {
syntax: 'ecmascript',
Expand All @@ -70,7 +69,6 @@ module.exports = {
exclude: /[\\/]node_modules[\\/]/,
loader: 'builtin:swc-loader',
options: {
sourceMaps: true,
jsc: {
parser: {
syntax: 'typescript',
Expand All @@ -95,7 +93,6 @@ module.exports = {
exclude: /[\\/]node_modules[\\/]/,
loader: 'builtin:swc-loader',
options: {
sourceMaps: true,
jsc: {
parser: {
syntax: 'typescript',
Expand Down
2 changes: 0 additions & 2 deletions website/docs/en/guide/builtin-swc-loader.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ module.exports = {
exclude: [/node_modules/],
loader: 'builtin:swc-loader',
options: {
sourceMaps: true,
jsc: {
parser: {
syntax: 'typescript',
Expand All @@ -46,7 +45,6 @@ module.exports = {
use: {
loader: 'builtin:swc-loader',
options: {
sourceMaps: true,
jsc: {
parser: {
syntax: 'ecmascript',
Expand Down
2 changes: 0 additions & 2 deletions website/docs/en/guide/migrate-from-webpack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ module.exports = {
+ exclude: [/[\\/]node_modules[\\/]/],
+ loader: 'builtin:swc-loader',
+ options: {
+ sourceMap: true,
+ jsc: {
+ parser: {
+ syntax: 'typescript',
Expand All @@ -67,7 +66,6 @@ module.exports = {
+ loader: 'builtin:swc-loader',
+ exclude: [/[\\/]node_modules[\\/]/],
+ options: {
+ sourceMap: true,
+ jsc: {
+ parser: {
+ syntax: 'typescript',
Expand Down
1 change: 0 additions & 1 deletion website/docs/en/guide/vue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ module.exports = {
test: /\.ts$/, // add this rule when you use typescript in Vue SFC
loader: 'builtin:swc-loader',
options: {
sourceMaps: true,
jsc: {
parser: {
syntax: 'typescript',
Expand Down
2 changes: 0 additions & 2 deletions website/docs/zh/blog/announcing-0.3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ const config = {
use: {
loader: 'builtin:swc-loader',
options: {
// Enable source map
sourceMap: true,
jsc: {
parser: {
syntax: 'ecmascript',
Expand Down
3 changes: 0 additions & 3 deletions website/docs/zh/blog/announcing-0.5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ module.exports = {
exclude: /[\\/]node_modules[\\/]/,
loader: 'builtin:swc-loader',
options: {
sourceMaps: true,
jsc: {
parser: {
syntax: 'ecmascript',
Expand All @@ -70,7 +69,6 @@ module.exports = {
exclude: /[\\/]node_modules[\\/]/,
loader: 'builtin:swc-loader',
options: {
sourceMaps: true,
jsc: {
parser: {
syntax: 'typescript',
Expand All @@ -95,7 +93,6 @@ module.exports = {
exclude: /[\\/]node_modules[\\/]/,
loader: 'builtin:swc-loader',
options: {
sourceMaps: true,
jsc: {
parser: {
syntax: 'typescript',
Expand Down
2 changes: 0 additions & 2 deletions website/docs/zh/guide/builtin-swc-loader.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ module.exports = {
exclude: [/node_modules/],
loader: 'builtin:swc-loader',
options: {
sourceMaps: true,
jsc: {
parser: {
syntax: 'typescript',
Expand All @@ -46,7 +45,6 @@ module.exports = {
use: {
loader: 'builtin:swc-loader',
options: {
sourceMaps: true,
jsc: {
parser: {
syntax: 'ecmascript',
Expand Down
2 changes: 0 additions & 2 deletions website/docs/zh/guide/migrate-from-webpack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ module.exports = {
+ exclude: [/[\\/]node_modules[\\/]/],
+ loader: 'builtin:swc-loader',
+ options: {
+ sourceMap: true,
+ jsc: {
+ parser: {
+ syntax: 'typescript',
Expand All @@ -67,7 +66,6 @@ module.exports = {
+ loader: 'builtin:swc-loader',
+ exclude: [/[\\/]node_modules[\\/]/],
+ options: {
+ sourceMap: true,
+ jsc: {
+ parser: {
+ syntax: 'typescript',
Expand Down
1 change: 0 additions & 1 deletion website/docs/zh/guide/vue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ module.exports = {
test: /\.ts$/, // 如果需要在 Vue SFC 里使用 TypeScript, 请添加该规则
loader: 'builtin:swc-loader',
options: {
sourceMaps: true,
jsc: {
parser: {
syntax: 'typescript',
Expand Down

2 comments on commit 6f80f58

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Ran ecosystem CI: Open

suite result
modernjs, self-hosted, Linux, ci ❌ failure
_selftest, ubuntu-latest ✅ success
nx, ubuntu-latest ✅ success
rspress, ubuntu-latest ✅ success
rsbuild, ubuntu-latest ✅ success
compat, ubuntu-latest ✅ success
examples, ubuntu-latest ✅ success

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

Name Base (2024-04-23 81c41c8) Current Change
10000_development-mode + exec 2.69 s ± 45 ms 2.68 s ± 25 ms -0.41 %
10000_development-mode_hmr + exec 682 ms ± 2.6 ms 685 ms ± 5.3 ms +0.44 %
10000_production-mode + exec 2.5 s ± 29 ms 2.51 s ± 37 ms +0.34 %
arco-pro_development-mode + exec 2.51 s ± 77 ms 2.47 s ± 61 ms -1.50 %
arco-pro_development-mode_hmr + exec 430 ms ± 2 ms 430 ms ± 2.4 ms +0.02 %
arco-pro_development-mode_hmr_intercept-plugin + exec 441 ms ± 4.3 ms 443 ms ± 0.92 ms +0.32 %
arco-pro_development-mode_intercept-plugin + exec 3.21 s ± 65 ms 3.26 s ± 61 ms +1.60 %
arco-pro_production-mode + exec 3.95 s ± 87 ms 3.98 s ± 66 ms +0.77 %
arco-pro_production-mode_intercept-plugin + exec 4.69 s ± 55 ms 4.69 s ± 205 ms -0.09 %
threejs_development-mode_10x + exec 2.06 s ± 20 ms 2.06 s ± 40 ms -0.16 %
threejs_development-mode_10x_hmr + exec 748 ms ± 8.2 ms 745 ms ± 4.9 ms -0.35 %
threejs_production-mode_10x + exec 5.15 s ± 49 ms 5.17 s ± 35 ms +0.31 %

Please sign in to comment.