webpack-contrib / bundle-loader

Bundle Loader
MIT License
658 stars 59 forks source link

[Bug] name parameter is completely ignored #39

Closed ArtemZag closed 6 years ago

ArtemZag commented 7 years ago

I tried to use different options. But it's simply ignored. Maybe the reason is that I use webpack 2.

michael-ciniawsky commented 7 years ago

@ArtemZag Could you please provide more info about your setup (webpack.config.js etc) ?

ArtemZag commented 7 years ago

@michael-ciniawsky I didn't configure bundle-loader in webpack config. I just used require function. Like this: const momentLocaleFile = require('bundle-loader?name=[path][name].[ext]?[hash]&lazy!moment/locale/' + momentLocale);

michael-ciniawsky commented 7 years ago

@ArtemZag So it is solved or still any regressions? 😛 Especially in regard to webpack 2 compatibility :)

ArtemZag commented 7 years ago

@michael-ciniawsky , sorry for late answer. Yes, the parameter is still ignored (using webpack 2). After the build I just get files like "1.js", "2.js" and so on. Like this: image

wisdomofgod commented 7 years ago

The reason for this may be that webpack didn't find require. ensure function

mikegleasonjr commented 6 years ago

Same thing here...

rule:

{
    test: /froala.js$/,
    include: [path.resolve(__dirname, 'src')],
    use: [{ loader: 'bundle-loader', options: { name: 'froala' } }],
},

output:

output: {
    path: path.resolve(__dirname, 'build'),
    filename: `[name].[chunkhash:6].${suffix}.js`,
    publicPath: '/',
},

The result is always something like build/0.82e16f.min.js.

ArtemZag commented 6 years ago

Tested with the last bundle-loader version. Now it works normally.