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
總結
以上是生活随笔為你收集整理的echart php mysql简书_echarts-自定义构建的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: adobe reader java_使用
- 下一篇: java equals 区别_Java中