简体   繁体   中英

webpack/babel transpile to system.register

I can successfully transpile es6 modules -> System.Register format using babel cli.

I would like to be able to transpile to System.Register format using babel from Webpack.

.babelrc

{
    "presets": ["es2015"],
    "plugins": ["transform-es2015-modules-systemjs"]
}

webpack.config.js

.....
.....
loaders: [ { 
        test   : /.js$/,
        exclude : /node_modules/,
        loader : 'babel-loader',
        query: {
            presets: ['es2015']
        }
    }
]
.....
.....

After running 'webpack', a warning is returned System.register is not supported by webpack.

I know this is self explanatory, my question is (which i have been unable to find the answer to after searching / investigating) -

Is this something that is going to be supported by webpack? Or if it is supported, what am i doing wrong?

Thanks,

Pretty out-of-date answer, but you could try "commonjs". It gets worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM