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
2 changes: 2 additions & 0 deletions packages/create-rspack/template-react-js/rspack.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "@rspack/cli";
Expand Down Expand Up @@ -29,6 +30,7 @@ export default defineConfig({
use: [
{
loader: "builtin:swc-loader",
/** @type {import('@rspack/core').SwcLoaderOptions} */
options: {
jsc: {
parser: {
Expand Down
4 changes: 2 additions & 2 deletions packages/create-rspack/template-react-ts/rspack.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "@rspack/cli";
import { rspack } from "@rspack/core";
import { rspack, type SwcLoaderOptions } from "@rspack/core";
import { ReactRefreshRspackPlugin } from "@rspack/plugin-react-refresh";

const isDev = process.env.NODE_ENV === "development";
Expand Down Expand Up @@ -40,7 +40,7 @@ export default defineConfig({
}
},
env: { targets }
}
} satisfies SwcLoaderOptions
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// @ts-check
import { defineConfig } from "@rspack/cli";
import { rspack } from "@rspack/core";

// Target browsers, see: https://github.com/browserslist/browserslist
const targets = ["last 2 versions", "> 0.2%", "not dead", "Firefox ESR"];
const targets = ["last 2 versions", "> 0.2%", "not dead", "Firefox ESR"];

export default defineConfig({
entry: {
Expand All @@ -19,6 +20,7 @@ export default defineConfig({
use: [
{
loader: "builtin:swc-loader",
/** @type {import('@rspack/core').SwcLoaderOptions} */
options: {
jsc: {
parser: {
Expand Down
8 changes: 4 additions & 4 deletions packages/create-rspack/template-vanilla-ts/rspack.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineConfig } from "@rspack/cli";
import { rspack } from "@rspack/core";
import { rspack, type SwcLoaderOptions } from "@rspack/core";

// Target browsers, see: https://github.com/browserslist/browserslist
const targets = ["last 2 versions", "> 0.2%", "not dead", "Firefox ESR"];
const targets = ["last 2 versions", "> 0.2%", "not dead", "Firefox ESR"];

export default defineConfig({
entry: {
Expand All @@ -29,7 +29,7 @@ export default defineConfig({
}
},
env: { targets }
}
} satisfies SwcLoaderOptions
}
]
},
Expand All @@ -45,7 +45,7 @@ export default defineConfig({
}
},
env: { targets }
}
} satisfies SwcLoaderOptions
}
]
}
Expand Down
6 changes: 2 additions & 4 deletions packages/create-rspack/template-vue-js/rspack.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
// @ts-check
import { defineConfig } from "@rspack/cli";
import { rspack } from "@rspack/core";
import { VueLoaderPlugin } from "vue-loader";

const __dirname = dirname(fileURLToPath(import.meta.url));

// Target browsers, see: https://github.com/browserslist/browserslist
const targets = ["last 2 versions", "> 0.2%", "not dead", "Firefox ESR"];

Expand All @@ -30,6 +27,7 @@ export default defineConfig({
use: [
{
loader: "builtin:swc-loader",
/** @type {import('@rspack/core').SwcLoaderOptions} */
options: {
jsc: {
parser: {
Expand Down
8 changes: 6 additions & 2 deletions packages/create-rspack/template-vue-ts/rspack.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { defineConfig } from "@rspack/cli";
import { type RspackPluginFunction, rspack } from "@rspack/core";
import {
type RspackPluginFunction,
rspack,
type SwcLoaderOptions
} from "@rspack/core";
import { VueLoaderPlugin } from "vue-loader";

// Target browsers, see: https://github.com/browserslist/browserslist
Expand Down Expand Up @@ -33,7 +37,7 @@ export default defineConfig({
}
},
env: { targets }
}
} satisfies SwcLoaderOptions
}
]
},
Expand Down
Loading