rsuite / babel-preset-rsuite

Modularly import rsuite components for babel.
https://rsuitejs.com/guide/usage
3 stars 0 forks source link

Encountered an Error: Can't resolve 'rsuite/lib/styles/button' #2

Open zhanbei opened 5 years ago

zhanbei commented 5 years ago

Hi, webpack is throwing me the Error: Can't resolve 'rsuite/lib/styles/button'.

I suppose this repo is somehow out of date, as the docs(https://rsuitejs.com/en/guide/modularized) stated:

import { Button } from 'rsuite'; should be translated to require('rsuite/lib/Button/styles/themes/dark.less'); with .babelrc set to { "presets": [["rsuite", { "style": true, "theme": "dark" }]] }.

while this repo stated that the same code will be translated to require('rsuite/styles/button.less');

FIY:

"rsuite": "^4.0.0",
"babel-preset-rsuite": "^0.1.1",
simonguo commented 5 years ago

Upgrade babel-preset-rsuite@4.0.0