echart php mysql简书_echarts-自定义构建

在学习自定义构建工具的时候遇到了麻烦,官网写的自定义有两种办法,跟着教程走了半天不幸的是两种方法一直报错,都未能成功。所以想把错误记录下来,请大家帮忙解决一下,百度后几种解决方法尝试无果。好在网站提供自定义组件的图形化自动生成模式,可以在页面生成自己想要的echart模版。

在安装的时候这个模块npm i rollup-plugin-uglify@3.0.0 需要安装这个版本的否则使用会出问题

第一种错误信息

//当我们运行这条命令的时候

node node_modules/echarts/build/build.js --min -i echarts.custom.js -o lib/echarts.custom.min.js

Bundles /Users/xinwang/Desktop/myProject/echarts.custom.js => /Users/xinwang/Desktop/myProject/lib/echarts.custom.min.js ...

Unknown input option: legacy. Allowed options: acorn, acornInjectPlugins, cache, chunkGroupingSize, context, experimentalCacheExpiry, experimentalOptimizeChunks, experimentalTopLevelAwait, external, inlineDynamicImports, input, manualChunks, moduleContext, onwarn, perf, plugins, preserveModules, preserveSymlinks, shimMissingExports, treeshake, watch

Error: Could not resolve entry (/Users/xinwang/Desktop/myProject/echarts.custom.js)

undefined

第二种自定义方式错误信息

//当我们运行这条命令的时候

./node_modules/.bin/rollup -c

!) You have passed an unrecognized option

Unknown input option: name. Allowed options: acorn, acornInjectPlugins, cache, chunkGroupingSize, context, experimentalCacheExpiry, experimentalOptimizeChunks, experimentalTopLevelAwait, external, inlineDynamicImports, input, manualChunks, moduleContext, onwarn, perf, plugins, preserveModules, preserveSymlinks, shimMissingExports, treeshake, watch

./line.js → lib/line.min.js...

(!) Missing exports

https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-

line.js

init is not exported by node_modules/echarts/lib/echarts.js

9: // 基于准备好的dom,初始化 echarts 实例并绘制图表。

10: //console.log(echarts)

11: echarts.init(document.getElementById('main')).setOption({

^什么鬼说这里没有这个方法

12: title: {text: 'Line Chart'},

13: tooltip: {},

(!) uglify plugin: The transformBundle hook used by plugin uglify is deprecated. The renderChunk hook should be used instead.

created lib/line.min.js in 801ms

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值