将ES6模块与WebPack一起使用,为什么还需要它

jus*_*don 3 javascript require reactjs webpack

在下面的代码示例中,为什么注释行无法导入标记?我正在使用https://github.com/shama/es6-loader

module $ from 'jquery';
module React from 'react';

//import { marked } from 'marked';
var marked = require("marked");
Run Code Online (Sandbox Code Playgroud)

这是一个示例存储库:https://github.com/justin808/react-tutorial-hot/tree/es6

此演示显示:1.Webpack和热重载2. React 3. ES6

pra*_*yer 6

您正在使用解构运算符,如果没有任何要解构的东西,即marked导出函数,它将无法工作.

import marked from 'marked' 应该工作.