feat: support option of babel-plugin-import (#3530)

This commit is contained in:
ClarkXia 2020-09-14 11:37:07 +08:00 committed by GitHub
parent 40458ea582
commit 318fc8056e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 0.1.6
- [feat] support option `importOptions` to specify babel-plugin-import options of `@alifd/next`
## 0.1.5
- [feat] support external fusion components

View File

@ -1,6 +1,6 @@
{
"name": "build-plugin-fusion",
"version": "0.1.5",
"version": "0.1.6",
"description": "plugin for build scripts while use fusion component",
"main": "lib/index.js",
"scripts": {

View File

@ -19,7 +19,7 @@ function normalizeEntry(entry, preparedChunks) {
}
module.exports = async ({ onGetWebpackConfig, log, context }, plugionOptions = {}) => {
const { themePackage, themeConfig, nextLibDir = 'es', style = true, uniteNextLib, externalNext } = plugionOptions;
const { themePackage, themeConfig, nextLibDir = 'es', style = true, uniteNextLib, externalNext, importOptions = {} } = plugionOptions;
let { uniteBaseComponent } = plugionOptions;
const { rootDir, pkg, userConfig, webpack } = context;
@ -146,6 +146,7 @@ module.exports = async ({ onGetWebpackConfig, log, context }, plugionOptions = {
libraryName: '@alifd/next',
libraryDirectory: nextLibDir,
style,
...importOptions,
}];
['jsx', 'tsx'].forEach((rule) => {
config.module