webpack-contrib / bundle-loader

Bundle Loader
MIT License
658 stars 59 forks source link

named chunk via query string using interpolateName #21

Closed rosskevin closed 8 years ago

rosskevin commented 8 years ago

I see the readme

require("bundle?lazy&name=my-chunk!./file.js");

points to the interpolateName of loader-utils.

Is there a way to use interpolation for the named chunk by declaring the pattern in the query string (or adding a function to the config)?

@see also StackOverflow related question

rosskevin commented 8 years ago

This query string will grab the name under the last routes directory:

loaders: [ 'bundle?lazy&name=[1]&regExp=routes\/(.*)\/components\/.*$', 'babel' ]