整体引入:
Converts
import { Button } from 'components'
to
var button = require('components/lib/button')
require('components/lib/button/style.css')
按需引入:
Converts
import Components from 'components'
import { Button } from 'components'
to
require('components/lib/styleLibraryName/index.css')
var button = require('components/lib/styleLibraryName/button.css')
1.installation :
npm i babel-plugin-component -D
2.usage:
在 .babelrc 中配置它:
{
"plugins": ["other-plugin", ["component", [
{ "libraryName": "mint-ui", "style": true }
]]]
}
相关文章:
-
2022-12-23
-
2021-11-30
-
2022-12-23
-
2022-12-23
-
2022-01-01
-
2021-08-28
-
2021-07-06
-
2022-12-23