-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b395246
commit dc77771
Showing
6 changed files
with
1,646 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import path from "node:path"; | ||
import { defineConfig } from "@rspack/cli"; | ||
import { version as reactVersion } from "react"; | ||
|
||
const prod = true; | ||
|
||
export default defineConfig({ | ||
target: "browserslist", | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.png$/, | ||
type: "asset", | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: ["style-loader", "css-loader", "postcss-loader"], | ||
}, | ||
{ | ||
test: /packages\/.*\/src\/.*\.[tj]sx?$/, | ||
use: ["babel-loader"], | ||
}, | ||
{ | ||
test: /\.(j|t)s$/, | ||
exclude: [/[\\/]node_modules[\\/]/], | ||
loader: "builtin:swc-loader", | ||
options: { | ||
jsc: { | ||
parser: { | ||
syntax: "typescript", | ||
}, | ||
externalHelpers: true, | ||
transform: { | ||
react: { | ||
runtime: "automatic", | ||
development: !prod, | ||
refresh: !prod, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
test: /\.(j|t)sx$/, | ||
loader: "builtin:swc-loader", | ||
exclude: [/[\\/]node_modules[\\/]/], | ||
options: { | ||
jsc: { | ||
parser: { | ||
syntax: "typescript", | ||
tsx: true, | ||
}, | ||
transform: { | ||
react: { | ||
runtime: "automatic", | ||
development: !prod, | ||
refresh: !prod, | ||
}, | ||
}, | ||
externalHelpers: true, | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
tsConfig: { | ||
configFile: path.resolve(__dirname, "./tsconfig.json"), | ||
references: "auto", | ||
}, | ||
alias: { | ||
react: path.resolve(__dirname, "node_modules/react"), | ||
"react-dom": path.resolve(__dirname, "node_modules/react-dom"), | ||
"cypress/react18": | ||
reactVersion.startsWith("16") || reactVersion.startsWith("17") | ||
? "cypress/react" | ||
: "cypress/react18", | ||
"@storybook/react-dom-shim": | ||
reactVersion.startsWith("16") || reactVersion.startsWith("17") | ||
? "@storybook/react-dom-shim/dist/react-16" | ||
: "@storybook/react-dom-shim", | ||
}, | ||
extensions: ["...", ".ts", ".tsx", ".js", ".jsx", ".css"], | ||
}, | ||
}); |
Oops, something went wrong.