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
23 changes: 11 additions & 12 deletions rspack/inline-const-enum/rspack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,42 @@
/** @type {import("@rspack/core").Configuration} */
export default {
entry: {
main: "./src/index.ts",
main: './src/index.ts',
},
experiments: {
inlineEnum: true,
},
mode: "production",
mode: 'production',
optimization: {
// This is the feature that enables inlining, it's enabled by default in production mode
inlineExports: true,
// disable minimize so you can understand the output
minimize: false,
},
resolve: {
extensions: [".ts", "..."],
extensions: ['.ts', '...'],
},
module: {
rules: [
{
test: /\.ts$/,
use: {
loader: "builtin:swc-loader",
loader: 'builtin:swc-loader',
/** @type {import("@rspack/core").SwcLoaderOptions} */
options: {
jsc: {
parser: {
syntax: "typescript",
syntax: 'typescript',
},
transform: {
tsEnumIsMutable: true,
}
},
},
rspackExperiments: {
collectTypeScriptInfo: {
exportedEnum: 'const-only',
}
}
},
},
},
},
type: "javascript/auto",
type: 'javascript/auto',
},
],
},
Expand Down
23 changes: 11 additions & 12 deletions rspack/inline-const/rspack.config.mjs
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
// @ts-check
import { rspack } from "@rspack/core";
import { rspack } from '@rspack/core';

/** @type {import("@rspack/core").Configuration} */
export default {
entry: {
main: "./src/index.ts",
main: './src/index.ts',
},
experiments: {
inlineConst: true,
},
mode: "production",
mode: 'production',
optimization: {
// This is the feature that enables inlining, it's enabled by default in production mode
inlineExports: true,
// disable minimize so you can understand the output
minimize: false,
},
resolve: {
extensions: [".ts", "..."],
extensions: ['.ts', '...'],
},
plugins: [
new rspack.DefinePlugin({
ENV: JSON.stringify("mobile"),
ENV: JSON.stringify('mobile'),
}),
],
module: {
rules: [
{
test: /\.ts$/,
use: {
loader: "builtin:swc-loader",
loader: 'builtin:swc-loader',
/** @type {import("@rspack/core").SwcLoaderOptions} */
options: {
jsc: {
parser: {
syntax: "typescript",
syntax: 'typescript',
},
target: "es2015", // use target es2015 or greater so swc won't transform const to var
target: 'es2015', // use target es2015 or greater so swc won't transform const to var
},
},
},
type: "javascript/auto",
type: 'javascript/auto',
},
],
},
Expand Down
23 changes: 11 additions & 12 deletions rspack/inline-enum/rspack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,39 @@
/** @type {import("@rspack/core").Configuration} */
export default {
entry: {
main: "./src/index.ts",
main: './src/index.ts',
},
experiments: {
inlineEnum: true,
},
mode: "production",
mode: 'production',
optimization: {
// This is the feature that enables inlining, it's enabled by default in production mode
inlineExports: true,
// disable minimize so you can understand the output
minimize: false,
},
resolve: {
extensions: [".ts", "..."],
extensions: ['.ts', '...'],
},
module: {
rules: [
{
test: /\.ts$/,
use: {
loader: "builtin:swc-loader",
loader: 'builtin:swc-loader',
/** @type {import("@rspack/core").SwcLoaderOptions} */
options: {
jsc: {
parser: {
syntax: "typescript",
}
syntax: 'typescript',
},
},
rspackExperiments: {
collectTypeScriptInfo: {
exportedEnum: true,
}
}
},
},
},
},
type: "javascript/auto",
type: 'javascript/auto',
},
],
},
Expand Down
25 changes: 11 additions & 14 deletions rspack/type-reexports-presence/rspack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,42 @@
/** @type {import("@rspack/core").Configuration} */
export default {
entry: {
main: "./src/index.ts",
main: './src/index.ts',
},
experiments: {
typeReexportsPresence: true,
},
mode: "production",
mode: 'production',
optimization: {
// disable minimize so you can understand the output
minimize: false,
},
resolve: {
extensions: [".ts", "..."],
extensions: ['.ts', '...'],
},
module: {
parser: {
javascript: {
typeReexportsPresence: "tolerant",
}
typeReexportsPresence: 'tolerant',
},
},
rules: [
{
test: /\.ts$/,
use: {
loader: "builtin:swc-loader",
loader: 'builtin:swc-loader',
/** @type {import("@rspack/core").SwcLoaderOptions} */
options: {
jsc: {
parser: {
syntax: "typescript",
}
syntax: 'typescript',
},
},
rspackExperiments: {
collectTypeScriptInfo: {
typeExports: true,
}
}
},
},
},
},
type: "javascript/auto",
type: 'javascript/auto',
},
],
},
Expand Down