无效的身份转义 WebpackEncore

问题描述 投票:0回答:1

我有一个工作的React应用程序,现在我把它迁移到symfony项目中。我有工作的webpack encore (在不同的应用程序中测试),但仍然得到了 SyntaxError: invalid identity escape in regular expression使用这个babel配置

    .configureBabel(function(babelConfig) {
        babelConfig.plugins.push('transform-class-properties');
        babelConfig.plugins.push('transform-regexp-constructors');
        babelConfig.plugins.push('@babel/transform-unicode-regex');
    })

给新手一些建议?

regex reactjs webpack babel symfony5
1个回答
0
投票

解决方法:添加 includeNodeModules: ['camelcase'] 到webpack.config.js。模块camelCase是麻烦的制造者。

© www.soinside.com 2019 - 2024. All rights reserved.