antvis / data-set

state driven all in one data process for data visualization.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webpack打包报错 Unexpected token: operator (>)

dreambo8563 opened this issue · comments

  • Link:
  • Platform:
  • Mini Showcase(like screenshots):

ERROR in scripts/f00180b2630cc99c1972.js from UglifyJs
Unexpected token: operator (>) [./node_modules/@antv/data-set/src/util/get-geo-projection.js:7,0][scripts/f00180b2630cc99c1972.js:1,120]

代码,项目地址:
https://github.com/dreambo8563/ts_react_mobx

直接clone项目 安装后 npm run build即可重现

这个错误是因为 你尝试用 UglifyJS 打包 ES6 版本的源码了。

如果要直接引用 DataSet 的源码,请先用 babel 进行编译

https://github.com/dreambo8563/ts_react_mobx/blob/master/tsconfig.json#L19

你可以在 tsconfig.json 里加上 include: ['node_modules/@antv/data-set/src']

inlcude 和exclude会冲突 ,暂时只能 引入 '@antv/data-set/build/data-set.js'