You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @ws18250840411, sorry we can't investigate the problem further without reproduction demo, please provide a repro demo by forking rspack-repro, or provide a minimal GitHub repository by yourself. Issues labeled by need reproduction will be closed if no activities in 14 days.
chenjiahan
changed the title
[Bug]:
[Bug]: camel2DashComponentName resulting in an error when loading the style on demand
Jan 9, 2025
System Info
System:
OS: macOS 10.15.7
CPU: 2.6 GHz 四核Intel Core i7
Binaries:
Node: 18.18.0 - ~/.nvm/versions/node/v18.18.0/bin/node
npm: 10.8.1 - ~/.nvm/versions/node/v22.3.0/bin/npm
Browsers:
Chrome: 131.0.6778.206
Safari: 17.2
Details
import { defineConfig } from "@rspack/cli";
import { rspack } from "@rspack/core";
import * as RefreshPlugin from "@rspack/plugin-react-refresh";
const isDev = process.env.NODE_ENV === "development";
const targets = ["chrome >= 87", "edge >= 88", "firefox >= 78", "safari >= 14"];
export default defineConfig({
// context: __dirname,
entry: {
main: "./src/main.tsx"
},
resolve: {
alias: {
},
extensions: ["...", ".ts", ".tsx", ".jsx", ".less", ".css", ".scss"]
},
module: {
rules: [
{
test: /.svg$/,
type: "asset"
},
{
test: /.less$/,
use: [
{
loader: 'less-loader',
},
],
type: 'css',
},
{
test: /.(jsx?|tsx?)$/,
use: [
{
loader: "builtin:swc-loader",
options: {
jsc: {
parser: {
syntax: "typescript",
tsx: true
},
transform: {
react: {
runtime: "automatic",
development: true,
refresh: true
}
}
},
rspackExperiments: {
import: [
{
libraryName: '@fexd/mobile',
libraryDirectory: 'es/exports',
camel2DashComponentName: false,
style: '{{member}}/style.css',
},
]
},
}
}
]
}
]
},
plugins: [
new rspack.HtmlRspackPlugin({
template: "./index.html"
}),
isDev ? new RefreshPlugin() : null
].filter(Boolean),
experiments: {
css: true,
},
optimization: {
minimizer: [
new rspack.SwcJsMinimizerRspackPlugin(),
new rspack.LightningCssMinimizerRspackPlugin({
minimizerOptions: { targets }
})
],
sideEffects: false
}
});
The configuration of camel2DashComponentName is invalid, resulting in an error when loading the style on demand.
Reproduce link
No response
Reproduce Steps
npm install
npm run start
The text was updated successfully, but these errors were encountered: