Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
464 views
in Technique[技术] by (71.8m points)

求助一个webpack 使用babel的问题:插件找不到

错误信息如下:
Unknown plugin "transform-es3-member-expression-literals" specified in "base" at 0, attempted to resolve relative to 'xxx/xxx/npm_a/'

我在 webpack.config.js 中配置了 babel ,以及几个插件;
在当前项目中的 package.json 已经安装了 bable 以及相关的plugins ,编译没问题,但是引入 npm_a 后,会出现上述的错误描述,一头雾水。。。
求前辈指点一二,非常感谢!

(应该不是插件的问题,因为删除掉一个插件,其他插件仍然会报错)

配置如下,请参考

如下

{
    test: /.js$/,
    include: /src|node_modules[/\]/,
    loader: 'babel-loader',
    options: {
        "presets": [
            [ "env",
                {
                "targets": {
                    "browsers": ["last 3 versions", "ie >= 9"]
                    }
                }
            //,"react"
            ],
        ],
        plugins: [
            'transform-es3-member-expression-literals',
            'transform-es3-property-literals',
            'transform-remove-strict-mode'
        ]
    }
},

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

贴下 package.json,你引入的这几个插件安装过了吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...