Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build error when the theme changes component style #53

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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: 1 addition & 1 deletion examples/rspack-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"@rspack/cli": "^0.1.8"
},
"dependencies": {
"@arco-design/theme-christmas": "^0.0.18",
"@arco-design/web-react": "^2.47.1",
"@arco-iconbox/react-partial-bits": "^0.0.3",
"@arco-plugins/unplugin-react": "workspace:*",
"@arco-themes/react-asuka": "^0.0.1",
"example-component-a": "workspace:*",
"ky": "^0.33.3",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/rspack-react/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
},
plugins: [
new ArcoDesignPlugin({
theme: '@arco-themes/react-asuka',
theme: path.resolve(__dirname, 'node_modules/@arco-design/theme-christmas'),
iconBox: '@arco-iconbox/react-partial-bits',
removeFontFace: true,
defaultLanguage: 'ja-JP',
Expand Down
2 changes: 1 addition & 1 deletion examples/rspack-react/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function App() {
<ol>
<Space direction="vertical" size="large">
<li>
<p>The color of button should be orange (theme: '@arco-themes/react-asuka'):</p>
<p>The button should be the Christmas style (theme: '@arco-design/theme-christmas'):</p>
<Button type="primary">Button</Button>
</li>
<li>
Expand Down
2 changes: 1 addition & 1 deletion packages/unplugin-react/src/plugins/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ThemePlugin {
if (ext === '.css') {
source = getFileSource(request);
} else if (ext === '.less') {
source = `;\n@import '~${request}';`;
source = `;\n@import '~${this.options.theme}/tokens.less';\n@import '~${request}';`;
} else {
throw new Error('Only accept to match css or less files.');
}
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ __metadata:
languageName: node
linkType: hard

"@arco-design/theme-christmas@npm:^0.0.18":
version: 0.0.18
resolution: "@arco-design/theme-christmas@npm:0.0.18"
peerDependencies:
"@arco-design/web-react": ^2.26.0
checksum: 4f4e4da648c1cee14bafc5e434dfa8d92b1a966dabbcd83090d80a3e4da4c4dfe219866257bbb3d493dccd49612d00b55bc0a39cee4e6ed9f53e02a2658d63a6
languageName: node
linkType: hard

"@arco-design/web-react@npm:^2.35.1":
version: 2.35.1
resolution: "@arco-design/web-react@npm:2.35.1"
Expand Down Expand Up @@ -194,15 +203,6 @@ __metadata:
languageName: unknown
linkType: soft

"@arco-themes/react-asuka@npm:^0.0.1":
version: 0.0.1
resolution: "@arco-themes/react-asuka@npm:0.0.1"
peerDependencies:
"@arco-design/web-react": ^2.47.1
checksum: 051970e604273a997988bb9723d55df070b06ab19c605beaf98d91d25d9f632d575de9d6d06774d2570839d74665c7b5807802a6c43ae04e22e473251c725f51
languageName: node
linkType: hard

"@arco-themes/react-plugin-test@npm:^0.0.1":
version: 0.0.1
resolution: "@arco-themes/react-plugin-test@npm:0.0.1"
Expand Down Expand Up @@ -7505,10 +7505,10 @@ __metadata:
version: 0.0.0-use.local
resolution: "example-rspack-react@workspace:examples/rspack-react"
dependencies:
"@arco-design/theme-christmas": ^0.0.18
"@arco-design/web-react": ^2.47.1
"@arco-iconbox/react-partial-bits": ^0.0.3
"@arco-plugins/unplugin-react": "workspace:*"
"@arco-themes/react-asuka": ^0.0.1
"@rspack/cli": ^0.1.8
example-component-a: "workspace:*"
ky: ^0.33.3
Expand Down