【问题标题】:Using ES6 modules in the browser [duplicate]在浏览器中使用 ES6 模块 [重复]
【发布时间】:2017-02-23 21:08:41
【问题描述】:

我正在尝试使用 ES6 模块在浏览器中导出和导入对象。

我试过了

import { options } from 'options';

但我收到错误 Uncaught SyntaxError: Unexpected token import。

然后我尝试编译它,但现在我收到错误Uncaught ReferenceError: require is not defined。

难道不能在浏览器中使用模块吗?

【问题讨论】:

标签: javascript import module ecmascript-6 export


【解决方案1】:

您可能想查看 http://jspm.io/ 它基于 system.js。

希望对您有所帮助..

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-10
    • 1970-01-01
    • 2017-06-03
    • 2018-11-11
    • 2015-07-31
    • 2018-10-24
    相关资源
    最近更新 更多