关于webpack打包babel配置报错Module build failed: TypeError: Cannot read property 'bindings' of null的解决方法...

webpack版本要与babel版本对应,否则即使配置项exclude配置了node_modules也可能会报错。babel配置详见GitHub地址

webpack 4.x | babel-loader 8.x | babel 7.x

对应指令

npm install -D babel-loader @babel/core @babel/preset-env webpack

webpack 1.x | babel-loader <= 6.x

webpack 2.x | babel-loader >= 7.x (recommended) (^6.2.10 will also work, but with deprecation warnings)

webpack 3.x | babel-loader >= 7.1

npm install --save-dev babel-loader babel-core babel-preset-env webpack

转载于:https://my.oschina.net/u/3447041/blog/3031515

你可能感兴趣的:(关于webpack打包babel配置报错Module build failed: TypeError: Cannot read property 'bindings' of null的解决方法...)