Node.js/webpack:修订间差异
来自康健生活
| 第610行: | 第610行: | ||
* TypeError: Cannot assign to read only property 'exports' of object '#<Object>' | * TypeError: Cannot assign to read only property 'exports' of object '#<Object>' | ||
*: 原因是在 babel-loader 组件中使用了 <code>useBuiltIns: 'usage'</code>,解决办法非常简单,就是在 <code>module.rules.exclude</code> 中将 css、scss 等不想被遍历的文件或文件夹排除过滤掉,由于新版 webpack 的 exclude 规则不再支持 string、array,以至于一个小时后才找到问题所在,新版使用正则进行过滤 <code>exclude: /((sc|sa|le|c)ss\/.*)|(node_modules\/.*)/</code> | *: 原因是在 babel-loader 组件中使用了 <code>useBuiltIns: 'usage'</code>,解决办法非常简单,就是在 <code>module.rules.exclude</code> 中将 css、scss 等不想被遍历的文件或文件夹排除过滤掉,由于新版 webpack 的 exclude 规则不再支持 string、array,以至于一个小时后才找到问题所在,新版使用正则进行过滤 <code>exclude: /((sc|sa|le|c)ss\/.*)|(node_modules\/.*)/</code> | ||
* Uncaught ReferenceError: _dll_commoncss is not defined | |||