javascript - Using Webpack and Babel to convert ES6 to AMD -
i'm using webpack in app, , have babel converting js/jsx files es6 es5.
i'd have babel convert module loading in these files amd. see how grunt-babel: using babel convert es6 modules es5 amd modules, not working expected
how if want webpack handle babel conversion?
for example, in webpack.config.js have:
module: { loaders: [{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel' } } can set option in there babel use amd?
you can set options babel query key:
module: { loaders: [{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel', query: { modules: 'amd' } } } for available options take here: http://babeljs.io/docs/usage/options/
Comments
Post a Comment