javascript - Multiple entry points without common chunks or dynamic loading -


i'm making chrome extension hosts multiple applications (multiple devtools panels), each 1 independent. need webpack watch multiple entry points , produce multiple bundles, don't need common chunks. not want use amd in client side code like this.

/appone     index.js     /components         /blah         /foobar /apptwo     index.js     /components         ..etc /appthree     index.js     /components         ..etc. /chrome     <- "dist" folder     /appone         index.html         bundle.js     /apptwo         index.html         bundle.js     /appthree         etc... 

as per docs on multiple entries i've been doing:

{     entry: {         appone: './appone/index.js',         apptwo: './apptwo/index.js'     },     output: {         path: path.join(__dirname, 'chrome', '[name]'),         filename: 'bundle.js' //can same since should output in different folders     } } 

i error:

path variable [name] not implemented in context: c:\users\admin\projects\crx\chrome\[name] 

so guess cannot have [name] variable in path setting multiple entries?

you should use [name] in filename field instead of path. looking @ docs, filename lists [name] variable , path not (only showing [hash]).

you use like:

{   path: path.join(__dirname, 'chrome'),   filename: '[name]/bundle.js' } 

the documentation not explicitly state filename can have multiple path segments, says filename must not absolute path.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -