11 Star 153 Fork 24

mallfoundry / taroify

 / 详情

按需导入导致编译很卡,Vscode直接挂掉

待办的
创建于  
2022-06-08 10:24

按照文档https://taroify.gitee.io/taroify.com/quickstart 的做法实现组件的按需导入, 发现实时编译导致CPU飙升,编辑器直接卡死, 干掉babel.config.js的plugins配置恢复正常。配置如选:

module.exports = {
    presets: [
        [
            'taro',
            {
                framework: 'react',
                ts: true
            }
        ]
    ],
    plugins: [
        [
            'import',
            {
                libraryName: '@taroify/core',
                libraryDirectory: '',
                style: true
            },
            '@taroify/core'
        ],
        [
            'import',
            {
                libraryName: '@taroify/icons',
                libraryDirectory: '',
                camel2DashComponentName: false,
                style: () => '@taroify/icons/style'
            },
            '@taroify/icons'
        ]
    ]
}

依赖如下:

"dependencies": {
        "@babel/runtime": "^7.17.2",
        "@taroify/core": "^0.0.29-alpha.9",
        "@tarojs/components": "3.4.11",
        "@tarojs/plugin-framework-react": "^3.4.11",
        "@tarojs/runtime": "3.4.11",
        "@tarojs/taro": "3.4.11",
        "classnames": "^2.3.1",
        "crypto-js": "^4.1.1",
        "dayjs": "^1.10.7",
        "react": "^17.0.2",
        "umtrack-wx": "^2.7.1"
    },
    "devDependencies": {
        "@babel/core": "^7.17.2",
        "@tarojs/cli": "3.4.11",
        "@tarojs/mini-runner": "3.4.11",
        "@tarojs/webpack-runner": "3.4.11",
        "@types/classnames": "^2.3.1",
        "@types/react": "^17.0.39",
        "@types/webpack-env": "^1.16.3",
        "@typescript-eslint/eslint-plugin": "^4.15.1",
        "@typescript-eslint/parser": "^4.15.1",
        "babel-plugin-import": "^1.13.3",
        "babel-preset-taro": "3.4.1",
        "cross-env": "^7.0.3",
        "eslint": "^6.8.0",
        "eslint-config-taro": "3.4.1",
        "eslint-plugin-import": "^2.12.0",
        "eslint-plugin-react": "^7.8.2",
        "eslint-plugin-react-hooks": "^4.2.0",
        "stylelint": "9.3.0",
        "taro-iconfont-cli": "^3.3.0",
        "typescript": "^4.5.5",
        "webpack-bundle-analyzer": "^4.5.0"
    }

0.0.29-alpha.8~9 均有这个问题

评论 (0)

sandercage 创建了任务
sandercage 修改了描述
展开全部操作日志

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(1)
TypeScript
1
https://gitee.com/mallfoundry/taroify.git
git@gitee.com:mallfoundry/taroify.git
mallfoundry
taroify
taroify

搜索帮助