Using ES6 Modules with WebPack Why More
In the example code below, why is the comment line not working for import marked? I am using https://github.com/shama/es6-loader
module $ from 'jquery';
module React from 'react';
//import { marked } from 'marked';
var marked = require("marked");
Here's a sample repository: https://github.com/justin808/react-tutorial-hot/tree/es6
This demo shows: 1. Webpack and Hot Reload 2. React 3. ES6
+3
source to share
2 answers
You are using a destructuring operator , which will not work if there is nothing to destruct, i.e. marked
exports a function.
import marked from 'marked'
must work.
+6
source to share
Es6-loader uses es6-module-transpiler which says that
ES6 module syntax is still going through a lot of glitches and will likely change before final approval.
Maybe the described syntax is not supported yet?
0
source to share