admin管理员组文章数量:1430855
I'm making a chrome extension that hosts multiple applications (multiple devtools panels), each one independent. I need webpack to watch multiple entry points and produce multiple bundles, I don't need mon chunks. I definitely do not want to use amd in the client side code like this.
/appOne
index.js
/ponents
/blah
/foobar
/appTwo
index.js
/ponents
..etc
/appThree
index.js
/ponents
..etc.
/chrome <- basically the "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 be the same since they should be output in different folders
}
}
I get the error:
Path variable [name] not implemented in this context: C:\Users\Admin\projects\crx\chrome\[name]
So I guess you cannot have the [name]
variable in the path
setting for multiple entries?
I'm making a chrome extension that hosts multiple applications (multiple devtools panels), each one independent. I need webpack to watch multiple entry points and produce multiple bundles, I don't need mon chunks. I definitely do not want to use amd in the client side code like this.
/appOne
index.js
/ponents
/blah
/foobar
/appTwo
index.js
/ponents
..etc
/appThree
index.js
/ponents
..etc.
/chrome <- basically the "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 be the same since they should be output in different folders
}
}
I get the error:
Path variable [name] not implemented in this context: C:\Users\Admin\projects\crx\chrome\[name]
So I guess you cannot have the [name]
variable in the path
setting for multiple entries?
-
I think
[name]
needs to be in the filename rather than the path, i.e.{path: path.join(__dirname, 'chrome'), filename: '[name].bundle.js'}
– ssube Commented Feb 8, 2016 at 16:59 - Yes, but then how can I specify a dynamic path for each output? That is, I don't want all bundles to be in the same folder. – Daniel Lizik Commented Feb 8, 2016 at 16:59
-
1
Oh wow you are right, i just did
[name]/bundle.js
instead, my god. – Daniel Lizik Commented Feb 8, 2016 at 17:00
1 Answer
Reset to default 9You should use [name]
in the filename field instead of path. Looking at the docs, filename lists the [name]
variable and path does not (only showing [hash]
).
You would use something like:
{
path: path.join(__dirname, 'chrome'),
filename: '[name]/bundle.js'
}
The documentation does not explicitly state the filename
can have multiple path segments, it only says the filename
must not be an absolute path.
本文标签: javascriptMultiple entry points without common chunks or dynamic loadingStack Overflow
版权声明:本文标题:javascript - Multiple entry points without common chunks or dynamic loading - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745565871a2663755.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论