rollup 使用问题解决集

1、在打包过程中过程中出现如下问题 use of eval is strongly discouraged

67286-oe5a0idvinq.png

解决方案:

添加 replace 插件,并进行插件配置

// rollup.config.js
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import replace from 'rollup-plugin-replace';
// ...etc

export default {
  // ...other config...
  plugins: [
    nodeResolve({...}),
    commonjs({...}),
    replace({
      include: 'node_modules/firebase/firebase.js',
      values: {
        'eval(' : '[eval][0]('
      }
    })
  ]
};
版权属于:

Ginkgo

本文链接:

https://imao2.com/article/104.html(转载时请注明本文出处及文章链接)

Ginkgo

一个今天胜过两个明天。

35 文章
0 评论
5 分类

标签云