You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/07/17 09:29:26 UTC

[GitHub] [incubator-echarts] dengshenkk commented on issue #10877: 怎么打包修改后的源码?

dengshenkk commented on issue #10877: 怎么打包修改后的源码? 
URL: https://github.com/apache/incubator-echarts/issues/10877#issuecomment-512178009
 
 
   @Ovilia 打包后dist中的文件怎么使用呢? 直接在vue组件中使用require引用dist文件中的echarts.js会报错呢
   
   1.添加依赖
   
   yarn
   yarn install v1.15.2
   warning package.json: License should be a valid SPDX license expression
   info No lockfile found.
   warning echarts@4.2.1: License should be a valid SPDX license expression
   [1/4] Resolving packages...
   [2/4] Fetching packages...
   [3/4] Linking dependencies...
   [4/4] Building fresh packages...
   
   success Saved lockfile.
   $ node build/build.js --prepublish
   D:\yongyou\code\mobile\node_modules\_echarts@4.2.1@echarts\node_modules\rimraf\rimraf.js:313
           throw er
           ^
   
   Error: ENOTEMPTY: directory not empty, rmdir 
   'xxx\_echarts@4.2.1@echarts\lib\chart'
       at Object.fs.rmdirSync (fs.js:846:18)
       at rmkidsSync 
   xxx\_echarts@4.2.1@echarts\node_modules\rimraf\rimraf.js:356:25)
       at rmdirSync 
   xxx\_echarts@4.2.1@echarts\node_modules\rimraf\rimraf.js:334:7)
       at rimrafSync 
   xxx\_echarts@4.2.1@echarts\node_modules\rimraf\rimraf.js:304:9)
       at 
   xxx\_echarts@4.2.1@echarts\node_modules\rimraf\rimraf.js:342:5
       at Array.forEach (<anonymous>)
       at rmkidsSync 
   xxx\_echarts@4.2.1@echarts\node_modules\rimraf\rimraf.js:341:26)
       at rmdirSync 
   xxx\_echarts@4.2.1@echarts\node_modules\rimraf\rimraf.js:334:7)
       at Function.rimrafSync [as sync] (
   xxx\_echarts@4.2.1@echarts\node_modules\rimraf\rimraf.js:304:9)
       at Object.removeSync 
   xxx\_echarts@4.2.1@echarts\node_modules\fs-extra\lib\remove\index.js:4:17)
   error Command failed with exit code 1.
   info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
   
   
   
   2.组件使用 my.vue
   require('libs/echarts.js')
   
   3.浏览器报错信息
   echarts.js?f2f4:4 Uncaught TypeError: Cannot set property 'echarts' of undefined
       at eval (echarts.js?f2f4:4)
       at Module.eval (echarts.js?f2f4:1)
       at eval (echarts.js:22940)
       at Module../libs/echarts.js (main.js:915)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org