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

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -