Immutable.js无法在Parcel下构建:意外令牌

时间:2018-11-12 19:00:23

标签: immutable.js parceljs

我正在运行一个构建,它看起来非常像非常流行的Immutable库简直就是破产。

$ NODE_ENV=development parcel build --public-url=./ --detailed-report --log-level=3 --no-minify ./index.html ./brands.html
  /home/robert/wkdir/beewell/mhp/node_modules/js-common/node_modules/immutable/contrib/cursor/index.js:25:0: Unexpected token (25:0)
23 |   '\n' +
24 |   'https://github.com/redbadger/immutable-cursor\n' +
25 | );
26 | 
27 | /**
28 |  * Cursor is expected to be required in a node or other CommonJS context:
error Command failed with exit code 1.

That code is, indeed, in the upstream.在我看来,第24行上有一个结尾的“ +”,这是合法的JavaScript语法错误。

但是不可变库很重要。我在他们的GitHub上没有发现任何与此相关的问题。我在项目中看不到Babel配置。因此,我觉得我必须做的是根本上错误的事情-我必须丢失某些事情-但我不能说是什么!

要明确指出这个问题:鉴于Immutable.js的代码库同时具有我和Parcel读取的语法错误,如何将它们捆绑在Parcel中?

0 个答案:

没有答案