Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions rspack/basic-ts/rspack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,15 @@ export default defineConfig({
module: {
rules: [
{
test: /\.(?:js|ts)$/,
test: /\.(?:js|mjs|cjs|ts|mts|cts)$/,
use: [
{
loader: 'builtin:swc-loader',
/**
* @type {import('@rspack/core').SwcLoaderOptions}
*/
options: {
jsc: {
parser: {
syntax: 'typescript',
},
},
detectSyntax: 'auto',
},
},
],
Expand Down
7 changes: 2 additions & 5 deletions rspack/builtin-swc-loader/rspack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,15 @@ export default defineConfig({
type: 'css',
},
{
test: /\.(jsx|js)$/,
test: /\.(?:js|mjs|jsx|ts|tsx)$/,
use: {
loader: 'builtin:swc-loader',
/**
* @type {import('@rspack/core').SwcLoaderOptions}
*/
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'ecmascript',
jsx: true,
},
transform: {
react: {
runtime: 'automatic',
Expand Down
24 changes: 3 additions & 21 deletions rspack/cra-ts/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ const config = {
type: 'css',
},
{
test: /\.tsx$/,
test: /\.(?:js|mjs|jsx|ts|tsx)$/,
exclude: /node_modules/,
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'typescript',
jsx: true,
},
externalHelpers: true,
preserveAllComments: false,
transform: {
Expand All @@ -38,22 +36,6 @@ const config = {
},
type: 'javascript/auto',
},
{
test: /\.ts$/,
use: {
loader: 'builtin:swc-loader',
options: {
jsc: {
parser: {
syntax: 'typescript',
},
externalHelpers: true,
preserveAllComments: false,
},
},
},
type: 'javascript/auto',
},
{
test: /\.svg$/,
type: 'asset/resource',
Expand Down
8 changes: 3 additions & 5 deletions rspack/cra/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ const config = {
type: 'css',
},
{
test: /\.jsx$/,
test: /\.(?:js|mjs|cjs|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'ecmascript',
jsx: true,
},
externalHelpers: true,
preserveAllComments: false,
transform: {
Expand Down
8 changes: 3 additions & 5 deletions rspack/emotion/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ const config = {
module: {
rules: [
{
test: /\.jsx$/,
test: /\.(?:js|mjs|cjs|jsx)$/,
exclude: /node_modules/,
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'ecmascript',
jsx: true,
},
transform: {
react: {
importSource: '@emotion/react',
Expand Down
2 changes: 1 addition & 1 deletion rspack/express/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const config = {
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'typescript',
decorators: true,
},
},
Expand Down
4 changes: 1 addition & 3 deletions rspack/inline-const-enum/rspack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ export default {
loader: 'builtin:swc-loader',
/** @type {import("@rspack/core").SwcLoaderOptions} */
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'typescript',
},
transform: {
tsEnumIsMutable: true,
},
Expand Down
4 changes: 1 addition & 3 deletions rspack/inline-const/rspack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ export default {
loader: 'builtin:swc-loader',
/** @type {import("@rspack/core").SwcLoaderOptions} */
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'typescript',
},
target: 'es2015', // use target es2015 or greater so swc won't transform const to var
},
},
Expand Down
6 changes: 1 addition & 5 deletions rspack/inline-enum/rspack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ export default {
loader: 'builtin:swc-loader',
/** @type {import("@rspack/core").SwcLoaderOptions} */
options: {
jsc: {
parser: {
syntax: 'typescript',
},
},
detectSyntax: 'auto',
collectTypeScriptInfo: {
exportedEnum: true,
},
Expand Down
8 changes: 3 additions & 5 deletions rspack/license-webpack-plugin/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ module.exports = defineConfig({
module: {
rules: [
{
test: /\.jsx$/,
test: /\.(?:js|mjs|cjs|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'ecmascript',
jsx: true,
},
externalHelpers: true,
preserveAllComments: false,
transform: {
Expand Down
7 changes: 2 additions & 5 deletions rspack/module-federation-v1.5/app/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ module.exports = {
module: {
rules: [
{
test: /\.js$/,
test: /\.(?:js|mjs|cjs|jsx)$/,
include: path.resolve(__dirname, 'src'),
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'ecmascript',
jsx: true,
},
transform: {
react: {
runtime: 'automatic',
Expand Down
7 changes: 2 additions & 5 deletions rspack/module-federation-v1.5/lib1/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ module.exports = {
module: {
rules: [
{
test: /\.js$/,
test: /\.(?:js|mjs|cjs|jsx)$/,
include: path.resolve(__dirname, 'src'),
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'ecmascript',
jsx: true,
},
transform: {
react: {
runtime: 'automatic',
Expand Down
7 changes: 2 additions & 5 deletions rspack/module-federation-v1.5/lib2/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ module.exports = {
module: {
rules: [
{
test: /\.js$/,
test: /\.(?:js|mjs|cjs|jsx)$/,
include: path.resolve(__dirname, 'src'),
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'ecmascript',
jsx: true,
},
transform: {
react: {
runtime: 'automatic',
Expand Down
7 changes: 2 additions & 5 deletions rspack/module-federation-v1/app/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ module.exports = {
module: {
rules: [
{
test: /\.js$/,
test: /\.(?:js|mjs|cjs|jsx)$/,
include: path.resolve(__dirname, 'src'),
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'ecmascript',
jsx: true,
},
transform: {
react: {
runtime: 'automatic',
Expand Down
7 changes: 2 additions & 5 deletions rspack/module-federation-v1/lib1/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ module.exports = {
module: {
rules: [
{
test: /\.js$/,
test: /\.(?:js|mjs|cjs|jsx)$/,
include: path.resolve(__dirname, 'src'),
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'ecmascript',
jsx: true,
},
transform: {
react: {
runtime: 'automatic',
Expand Down
7 changes: 2 additions & 5 deletions rspack/module-federation-v1/lib2/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ module.exports = {
module: {
rules: [
{
test: /\.js$/,
test: /\.(?:js|mjs|cjs|jsx)$/,
include: path.resolve(__dirname, 'src'),
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'ecmascript',
jsx: true,
},
transform: {
react: {
runtime: 'automatic',
Expand Down
24 changes: 3 additions & 21 deletions rspack/monaco-editor-ts-react/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ module.exports = {
type: 'asset/resource',
},
{
test: /\.tsx$/,
test: /\.(?:js|mjs|jsx|ts|tsx)$/,
exclude: /node_modules/,
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'typescript',
jsx: true,
},
externalHelpers: true,
preserveAllComments: false,
transform: {
Expand All @@ -51,22 +49,6 @@ module.exports = {
},
type: 'javascript/auto',
},
{
test: /\.ts$/,
use: {
loader: 'builtin:swc-loader',
options: {
jsc: {
parser: {
syntax: 'typescript',
},
externalHelpers: true,
preserveAllComments: false,
},
},
},
type: 'javascript/auto',
},
],
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion rspack/nestjs/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const config = {
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
parser: {
syntax: 'typescript',
decorators: true,
},
transform: {
Expand Down
3 changes: 2 additions & 1 deletion rspack/polyfill/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ const config = {
module: {
rules: [
{
test: /\.js$/,
test: /\.(?:js|mjs|cjs)$/,
exclude: /node_modules/,
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
env: {
targets: ['> 0.01%', 'not dead', 'not op_mini all'],
mode: 'usage',
Expand Down
8 changes: 3 additions & 5 deletions rspack/preact-refresh/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ const config = {
type: 'css',
},
{
test: /\.jsx$/,
test: /\.(?:js|mjs|cjs|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'builtin:swc-loader',
options: {
detectSyntax: 'auto',
jsc: {
experimental: {
plugins: [
Expand All @@ -35,10 +37,6 @@ const config = {
],
],
},
parser: {
syntax: 'ecmascript',
jsx: true,
},
externalHelpers: true,
preserveAllComments: false,
transform: {
Expand Down
Loading
Loading