Skip to content

Commit

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

* 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

0 comments on commit 6f80f58

Please sign in to comment.