Babel 7和node_modules

时间:2018-12-11 07:02:33

标签: webpack node-modules babel babel-loader babel-polyfill

我从v6迁移到v7 babel,现在node_modules编译不起作用。

babel.config.js

module.exports = function (api)
{
    api.cache(true);

    const presets = [
        [
            "@babel/preset-env",
            {
                // "modules": false,
                "useBuiltIns": "usage",
                "targets": "> 1%, not dead, IE >= 11",
            }
        ]
    ];

    const plugins = [
        "@babel/plugin-syntax-dynamic-import",
        "@babel/plugin-proposal-object-rest-spread",
        "async-to-promises",
    ];

    return {
        presets,
        plugins
    };
}

webpack.config.js(babel-loader)

} , {
            test: /\.js$/,
            loader: 'babel-loader?cacheDirectory=true',
            options: {
                configFile: path.join(__dirname, './babel.config.js')
            },
            include: [
                path.join(__dirname, './resources/assets/js/'),
                /\/node_modules\/quill/,
                /\/node_modules\/vue-masonry/,
            ]
        },

当我做npm run build

我有很多错误,例如:

WARNING in ./node_modules/quill/core/editor.js 96:25-32 "export 'default' (imported as 'DeltaOp') was not found in 'quill-delta/lib/op'

我该如何解决问题?尝试了很多东西但没有运气。

我需要构建quill-js以支持旧的浏览器

0 个答案:

没有答案