Skip to content

Commit 7624615

Browse files
committed
added chunk output file to web-worker example
1 parent 85bda0d commit 7624615

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

examples/web-worker/README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,79 @@ onmessage = function(event) {
132132

133133
```
134134

135+
# js/1.[hash].worker.hs
136+
137+
``` javascript
138+
webpackChunk([1], {
139+
140+
/***/ 1:
141+
/*!*********************************************!*\
142+
!*** ../require.context/templates ^\.\/.*$ ***!
143+
\*********************************************/
144+
/***/ function(module, exports, require) {
145+
146+
var map = {
147+
"./a": 2,
148+
"./a.js": 2,
149+
"./b": 3,
150+
"./b.js": 3,
151+
"./c": 4,
152+
"./c.js": 4
153+
};
154+
function webpackContext(req) {
155+
return require(webpackContextResolve(req));
156+
};
157+
function webpackContextResolve(req) {
158+
return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
159+
};
160+
webpackContext.keys = function webpackContextKeys() {
161+
return Object.keys(map);
162+
};
163+
webpackContext.resolve = webpackContextResolve;
164+
module.exports = webpackContext;
165+
166+
167+
/***/ },
168+
169+
/***/ 2:
170+
/*!*****************************************!*\
171+
!*** ../require.context/templates/a.js ***!
172+
\*****************************************/
173+
/***/ function(module, exports, require) {
174+
175+
module.exports = function() {
176+
return "This text was generated by template A";
177+
}
178+
179+
/***/ },
180+
181+
/***/ 3:
182+
/*!*****************************************!*\
183+
!*** ../require.context/templates/b.js ***!
184+
\*****************************************/
185+
/***/ function(module, exports, require) {
186+
187+
module.exports = function() {
188+
return "This text was generated by template B";
189+
}
190+
191+
/***/ },
192+
193+
/***/ 4:
194+
/*!*****************************************!*\
195+
!*** ../require.context/templates/c.js ***!
196+
\*****************************************/
197+
/***/ function(module, exports, require) {
198+
199+
module.exports = function() {
200+
return "This text was generated by template C";
201+
}
202+
203+
/***/ }
204+
205+
})
206+
```
207+
135208
# Info
136209

137210
## Uncompressed

examples/web-worker/template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
{{js/hash.worker.js}}
2424
```
2525

26+
# js/1.[hash].worker.hs
27+
28+
``` javascript
29+
{{js/1.hash.worker.js}}
30+
```
31+
2632
# Info
2733

2834
## Uncompressed

0 commit comments

Comments
 (0)