[英]Using ES6 modules with WebPack, why require still needed
在下面的代码示例中,为什么注释行无法导入标记? 我正在使用https://github.com/shama/es6-loader
module $ from 'jquery';
module React from 'react';
//import { marked } from 'marked';
var marked = require("marked");
这是一个示例存储库: https : //github.com/justin808/react-tutorial-hot/tree/es6
此演示显示:1。Webpack和热重载2. React 3. ES6
你正在使用解构运算符 ,如果没有什么可以解构,那就不会工作,即marked
导出函数。
import marked from 'marked'
应该可行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.