mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 03:46:08 +00:00
fix: rspack config
This commit is contained in:
parent
8e93a530b3
commit
d5ac5fd38c
@ -326,6 +326,9 @@ export async function buildPluginClient(cwd: string, userConfig: UserConfig, sou
|
||||
umdNamedDefine: true,
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json', '.less', '.css'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
@ -390,20 +393,57 @@ export async function buildPluginClient(cwd: string, userConfig: UserConfig, sou
|
||||
issuer: /\.[jt]sx?$/,
|
||||
use: ['@svgr/webpack'],
|
||||
},
|
||||
{
|
||||
test: /\.jsx$/,
|
||||
exclude: /[\\/]node_modules[\\/]/,
|
||||
loader: 'builtin:swc-loader',
|
||||
options: {
|
||||
sourceMap: true,
|
||||
jsc: {
|
||||
parser: {
|
||||
syntax: 'ecmascript',
|
||||
jsx: true,
|
||||
},
|
||||
target: "es5"
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.tsx$/,
|
||||
exclude: /[\\/]node_modules[\\/]/,
|
||||
loader: 'builtin:swc-loader',
|
||||
options: {
|
||||
sourceMap: true,
|
||||
jsc: {
|
||||
parser: {
|
||||
syntax: 'typescript',
|
||||
tsx: true,
|
||||
},
|
||||
target: "es5"
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
exclude: /[\\/]node_modules[\\/]/,
|
||||
loader: 'builtin:swc-loader',
|
||||
options: {
|
||||
sourceMap: true,
|
||||
jsc: {
|
||||
parser: {
|
||||
syntax: 'typescript',
|
||||
},
|
||||
target: "es5"
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
builtins: {
|
||||
define: {
|
||||
plugins: [
|
||||
new rspack.DefinePlugin({
|
||||
"process.env.NODE_ENV": "'production'",
|
||||
},
|
||||
react: {
|
||||
development: false,
|
||||
refresh: false,
|
||||
},
|
||||
presetEnv: {
|
||||
targets: ['Chrome >= 48'], // 要修改
|
||||
}
|
||||
},
|
||||
})
|
||||
],
|
||||
node: {
|
||||
global: true,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user