dailymotion / webpack-multi-output

Webpack loader/plugin for multiple compiling with crazy performances
MIT License
14 stars 6 forks source link

babeljs #3

Open octavioturra opened 8 years ago

octavioturra commented 8 years ago

Hi,

I'm using it to proccess application versions. Each version is a simply js archive which points to a group of components and outputs a route component.

Then, I have 3 versions in simple.v1.js, advanced.v2.js and a configuration of:

module.exports = {
  entry: path.join(__dirname, 'src/index.js'),
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js',
  },
  module: {
    loaders: [
      {
        test: /\.v(\d+).js$/,
        loader: 'webpack-multi-output!babel',
      }
    ]
  },
  plugins: [
    new WebpackMultiOutputPlugin({
      values: ['v1', 'v2']
    })
  ]
}

In my output, babel have not compiled the content, also, it's imports have not been imported.

Can you help me?

romainberger commented 8 years ago

Hi,

My bad the documentation is not 100% complete, and I meant to add some details about this kind of stuff.

Sadly the plugin won't work for this kind of usage. The content of the files required are simply included in the bundle where the require is done, there is no actual compilation, which means there is no babel happening or anything. It's just a replace of the content.

We just use it for json, which is why there we have no issue. To make the plugin use loaders it would probably need a lot of work.

Sorry, I guess the plugin won't work for your usage.