Compare commits
232 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
ac3fe4ba1c | |
|
|
aedc623c77 | |
|
|
672f34bc98 | |
|
|
0cf580c628 | |
|
|
7ca7cb7702 | |
|
|
09a96f5500 | |
|
|
cb150718a3 | |
|
|
6f15d185da | |
|
|
bd043db35d | |
|
|
2cc10df68f | |
|
|
9665c63362 | |
|
|
2751adeee9 | |
|
|
efd1f7886a | |
|
|
d77b399f34 | |
|
|
7a2aa84fdb | |
|
|
9b272cfb2b | |
|
|
7a43f1043a | |
|
|
cc6ba28688 | |
|
|
b4bd75f5fe | |
|
|
b8fd1427bc | |
|
|
5a764334c0 | |
|
|
eeb94b565f | |
|
|
810771e316 | |
|
|
dc32a23996 | |
|
|
eb6a54fd46 | |
|
|
4ac7bfa8dc | |
|
|
ef1915a4ee | |
|
|
e71b512548 | |
|
|
d45e980e7d | |
|
|
2d5c42ff18 | |
|
|
73a01bdcaf | |
|
|
9bdb6189ea | |
|
|
61ec618c53 | |
|
|
9d7aa21377 | |
|
|
cbbb4a9aec | |
|
|
41dce566c3 | |
|
|
6dd753c3ba | |
|
|
7a781a4120 | |
|
|
1b4f8efe94 | |
|
|
26c95e9c4b | |
|
|
45099373d9 | |
|
|
d07d1ebf66 | |
|
|
2f4c88355c | |
|
|
ecc0784af5 | |
|
|
d22c23066a | |
|
|
90c6b90279 | |
|
|
f3abe9f6ae | |
|
|
be5d67af5b | |
|
|
9046e46d12 | |
|
|
8fbee6a732 | |
|
|
ef41d98bd0 | |
|
|
06b49ff363 | |
|
|
6657d38873 | |
|
|
e7c44ab1b5 | |
|
|
b2db3f91e9 | |
|
|
ff249a57b4 | |
|
|
8ed2159b9d | |
|
|
03320747dc | |
|
|
bac1cd4469 | |
|
|
fe5580985e | |
|
|
1a2e2b3e94 | |
|
|
4e29b022b8 | |
|
|
9757d3df30 | |
|
|
03758f46cc | |
|
|
62c9e70113 | |
|
|
4e9582556f | |
|
|
8b79742f6f | |
|
|
55d5370b71 | |
|
|
263b5b6bde | |
|
|
9d00ad79ed | |
|
|
93b69a3646 | |
|
|
91ba00ea5a | |
|
|
e493064c34 | |
|
|
d0105fd7a7 | |
|
|
fb18de08a0 | |
|
|
8fbbf69e50 | |
|
|
2f2c88bbdb | |
|
|
d1f9330715 | |
|
|
c6b45b314e | |
|
|
943c555665 | |
|
|
4e6f902cab | |
|
|
e493348953 | |
|
|
fa25bd7718 | |
|
|
6c516a85c2 | |
|
|
b9f0c9e92f | |
|
|
86badc3d6e | |
|
|
c43bb4359f | |
|
|
c2982a8977 | |
|
|
c54273563a | |
|
|
f3e4ead0f5 | |
|
|
c229fcbab2 | |
|
|
998ebf03eb | |
|
|
3a10699319 | |
|
|
390635a519 | |
|
|
7230b6a537 | |
|
|
b718dc1c2c | |
|
|
0952b3a810 | |
|
|
05d6694743 | |
|
|
52f53faf45 | |
|
|
a252bca92c | |
|
|
3e751b7046 | |
|
|
c6f59019b3 | |
|
|
10058066d7 | |
|
|
129c42e8d0 | |
|
|
cdd97c3279 | |
|
|
0a9d8e8417 | |
|
|
20ac9e9fc5 | |
|
|
b9ae47983c | |
|
|
72c33d7b3e | |
|
|
37bf50d662 | |
|
|
bfed3a29cc | |
|
|
765002458b | |
|
|
c0b730f25d | |
|
|
b8532f436d | |
|
|
4fc5328411 | |
|
|
4dc976e396 | |
|
|
f89eb945ec | |
|
|
25fd764e16 | |
|
|
c776cdd586 | |
|
|
3ad0f9fba6 | |
|
|
a009406838 | |
|
|
4ab5f1bdb1 | |
|
|
def0703e71 | |
|
|
29871bd0f5 | |
|
|
fab60bed44 | |
|
|
831cbdecb8 | |
|
|
40b065808c | |
|
|
935eefb291 | |
|
|
f616f2e22f | |
|
|
a04434a225 | |
|
|
e4e9555209 | |
|
|
9066ad2ad3 | |
|
|
4114403df2 | |
|
|
58681c3bdb | |
|
|
854242a24c | |
|
|
890353b6e4 | |
|
|
75adbcb066 | |
|
|
67ca550b99 | |
|
|
eb01c774f2 | |
|
|
b613824bf8 | |
|
|
f8abc156b5 | |
|
|
7af56dbb99 | |
|
|
bf5901e5c0 | |
|
|
c4587c1443 | |
|
|
5ca4d1610a | |
|
|
13e9a2ed2f | |
|
|
4a817ab2c3 | |
|
|
419c2e6121 | |
|
|
07d410d477 | |
|
|
3005cec0f9 | |
|
|
f707c98d32 | |
|
|
183eab1e83 | |
|
|
24a4ea0df4 | |
|
|
4d3c7319ed | |
|
|
2fd075ff21 | |
|
|
dbd508027b | |
|
|
75175a6297 | |
|
|
3897896265 | |
|
|
4a69c9a013 | |
|
|
05b2abde73 | |
|
|
313a83115a | |
|
|
a21b79aeb1 | |
|
|
0b4d7383ea | |
|
|
73a5ef7bef | |
|
|
19f0eeb0d2 | |
|
|
713643f84f | |
|
|
b65c39c2f1 | |
|
|
e3c7975d78 | |
|
|
c883a8663c | |
|
|
a5174be6f2 | |
|
|
617abd6a4d | |
|
|
18b4c4c912 | |
|
|
7f81466c14 | |
|
|
63e4ad6fc7 | |
|
|
453975ee0f | |
|
|
97cd17083a | |
|
|
07fb7560b6 | |
|
|
2ed44aad42 | |
|
|
6818eedc2d | |
|
|
99a8d7e4fd | |
|
|
3f38901758 | |
|
|
5fb1eca651 | |
|
|
0bdc43f478 | |
|
|
6f008c431c | |
|
|
ea9782d1b9 | |
|
|
ac60b8e290 | |
|
|
36c762a834 | |
|
|
3fedf6ac33 | |
|
|
f8de79cce5 | |
|
|
bee33c4081 | |
|
|
78c4e32bb0 | |
|
|
d49c2207c5 | |
|
|
cd77e8a727 | |
|
|
70df65d9e5 | |
|
|
01d7dd602d | |
|
|
9e8259ae26 | |
|
|
08fb649710 | |
|
|
8eb8c86be4 | |
|
|
bf48112fa9 | |
|
|
a35e5e3b84 | |
|
|
d5c4e08457 | |
|
|
c4ee1738e7 | |
|
|
3da52a6001 | |
|
|
f74928b6e6 | |
|
|
b42074844c | |
|
|
b286cea3d2 | |
|
|
9e7cc462ba | |
|
|
e566dac40d | |
|
|
df2e4728ab | |
|
|
0450b45c40 | |
|
|
26c87253ca | |
|
|
f108db0737 | |
|
|
5ec7e2dc59 | |
|
|
64ff092c1f | |
|
|
954aa98339 | |
|
|
aadf384a62 | |
|
|
ad02508db1 | |
|
|
dd1518a260 | |
|
|
c6cb00c4fe | |
|
|
70259ea4b9 | |
|
|
579839b0a6 | |
|
|
9622634173 | |
|
|
796bcbe19c | |
|
|
c556925234 | |
|
|
2ef2ead8ff | |
|
|
6262921f3f | |
|
|
0b0e0205fc | |
|
|
83ad4de679 | |
|
|
10e8b5e0a4 | |
|
|
0a1f3a4464 | |
|
|
b8b7586717 | |
|
|
41a255a2f1 |
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"ignore": [
|
||||||
|
"**/examples/**",
|
||||||
|
"**/node_modules/**",
|
||||||
|
],
|
||||||
|
"test": [
|
||||||
|
"**/spec/**"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
<!-- CLICK "Preview" FOR INSTRUCTIONS IN A MORE READABLE FORMAT -->
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- We realize there is a lot of data requested here. We ask only that you do your best to provide as much information as possible so we can better help you.
|
||||||
|
- Support questions are better asked in one of the following locations:
|
||||||
|
- [Stack Overflow](http://stackoverflow.com/questions/tagged/html-webpack-plugin)
|
||||||
|
- Ensure the issue isn't already reported.
|
||||||
|
- Should be reproducible with the latest version of `html-webpack-plugin`.
|
||||||
|
- (Ensure `npm ls html-webpack-plugin` matches )
|
||||||
|
|
||||||
|
*Delete the above section and the instructions in the sections below before submitting*
|
||||||
|
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
If this is a feature request, explain why it should be added. Specific use-cases are best.
|
||||||
|
|
||||||
|
For bug reports, please provide as much *relevant* info as possible.
|
||||||
|
|
||||||
|
### Error Message & Stack Trace
|
||||||
|
|
||||||
|
```
|
||||||
|
COPY THE ERROR MESSAGE, INCLUDING STACK TRACE HERE
|
||||||
|
```
|
||||||
|
|
||||||
|
### Config
|
||||||
|
|
||||||
|
Copy the relevant section from `webpack.config.js`:
|
||||||
|
|
||||||
|
```js
|
||||||
|
module.exports = {
|
||||||
|
entry: 'app.js',
|
||||||
|
output: {
|
||||||
|
path: 'dist',
|
||||||
|
filename: 'index_bundle.js'
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
...
|
||||||
|
]
|
||||||
|
}
|
||||||
|
plugins: [
|
||||||
|
new HtmlWebpackPlugin(),
|
||||||
|
...
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Copy your template file:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My App</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Relevant Links
|
||||||
|
|
||||||
|
- If your project is public, link to the repo so we can investigate directly.
|
||||||
|
- **BONUS POINTS:** Create a [minimal reproduction](http://stackoverflow.com/help/mcve) and upload it to GitHub. This will get you the fastest support.
|
||||||
|
|
||||||
|
|
||||||
|
## Environment
|
||||||
|
|
||||||
|
Tell us which operating system you are using, as well as which versions of Node.js, npm, webpack, and html-webpack-plugin. Run the following to get it quickly:
|
||||||
|
|
||||||
|
```
|
||||||
|
node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())"
|
||||||
|
npm --version
|
||||||
|
npm ls webpack
|
||||||
|
npm ls html-webpack-plugin
|
||||||
|
```
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
/node_modules/
|
/node_modules/
|
||||||
/dist/
|
/dist/
|
||||||
examples/*/dist
|
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
|
|
||||||
95
.jshintrc
|
|
@ -1,95 +0,0 @@
|
||||||
{
|
|
||||||
// From JSHint Default Configuration File
|
|
||||||
// See http://jshint.com/docs/ for more details
|
|
||||||
|
|
||||||
"maxerr" : 50, // {int} Maximum error before stopping
|
|
||||||
|
|
||||||
// Enforcing
|
|
||||||
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
|
|
||||||
"camelcase" : false, // true: Identifiers must be in camelCase
|
|
||||||
"curly" : true, // true: Require {} for every new block or scope
|
|
||||||
"eqeqeq" : true, // true: Require triple equals (===) for comparison
|
|
||||||
"forin" : false, // true: Require filtering for..in loops with obj.hasOwnProperty()
|
|
||||||
"freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
|
|
||||||
"immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
|
|
||||||
"indent" : 2, // {int} Number of spaces to use for indentation
|
|
||||||
"latedef" : false, // true: Require variables/functions to be defined before being used
|
|
||||||
"newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()`
|
|
||||||
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
|
|
||||||
"noempty" : true, // true: Prohibit use of empty blocks
|
|
||||||
"nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters.
|
|
||||||
"nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
|
|
||||||
"plusplus" : false, // true: Prohibit use of `++` & `--`
|
|
||||||
"quotmark" : false, // Quotation mark consistency:
|
|
||||||
// false : do nothing (default)
|
|
||||||
// true : ensure whatever is used is consistent
|
|
||||||
// "single" : require single quotes
|
|
||||||
// "double" : require double quotes
|
|
||||||
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
|
|
||||||
"unused" : true, // true: Require all defined variables be used
|
|
||||||
"strict" : true, // true: Requires all functions run in ES5 Strict Mode
|
|
||||||
"maxparams" : false, // {int} Max number of formal params allowed per function
|
|
||||||
"maxdepth" : false, // {int} Max depth of nested blocks (within functions)
|
|
||||||
"maxstatements" : false, // {int} Max number statements per function
|
|
||||||
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function
|
|
||||||
"maxlen" : false, // {int} Max number of characters per line
|
|
||||||
|
|
||||||
// Relaxing
|
|
||||||
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
|
|
||||||
"boss" : false, // true: Tolerate assignments where comparisons would be expected
|
|
||||||
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
|
|
||||||
"eqnull" : false, // true: Tolerate use of `== null`
|
|
||||||
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
|
|
||||||
"esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
|
|
||||||
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
|
|
||||||
// (ex: `for each`, multiple try/catch, function expression…)
|
|
||||||
"evil" : false, // true: Tolerate use of `eval` and `new Function()`
|
|
||||||
"expr" : false, // true: Tolerate `ExpressionStatement` as Programs
|
|
||||||
"funcscope" : false, // true: Tolerate defining variables inside control statements
|
|
||||||
"globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
|
|
||||||
"iterator" : false, // true: Tolerate using the `__iterator__` property
|
|
||||||
"lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
|
|
||||||
"laxbreak" : false, // true: Tolerate possibly unsafe line breakings
|
|
||||||
"laxcomma" : false, // true: Tolerate comma-first style coding
|
|
||||||
"loopfunc" : true, // true: Tolerate functions being defined in loops
|
|
||||||
"multistr" : false, // true: Tolerate multi-line strings
|
|
||||||
"noyield" : false, // true: Tolerate generator functions with no yield statement in them.
|
|
||||||
"notypeof" : false, // true: Tolerate invalid typeof operator values
|
|
||||||
"proto" : false, // true: Tolerate using the `__proto__` property
|
|
||||||
"scripturl" : false, // true: Tolerate script-targeted URLs
|
|
||||||
"shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
|
|
||||||
"sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
|
|
||||||
"supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
|
|
||||||
"validthis" : false, // true: Tolerate using this in a non-constructor function
|
|
||||||
|
|
||||||
// Environments
|
|
||||||
"browser" : true, // Web Browser (window, document, etc)
|
|
||||||
"browserify" : false, // Browserify (node.js code in the browser)
|
|
||||||
"couch" : false, // CouchDB
|
|
||||||
"devel" : true, // Development/debugging (alert, confirm, etc)
|
|
||||||
"dojo" : false, // Dojo Toolkit
|
|
||||||
"jasmine" : false, // Jasmine
|
|
||||||
"jquery" : false, // jQuery
|
|
||||||
"mocha" : true, // Mocha
|
|
||||||
"mootools" : false, // MooTools
|
|
||||||
"node" : true, // Node.js
|
|
||||||
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
|
|
||||||
"prototypejs" : false, // Prototype and Scriptaculous
|
|
||||||
"qunit" : false, // QUnit
|
|
||||||
"rhino" : false, // Rhino
|
|
||||||
"shelljs" : false, // ShellJS
|
|
||||||
"worker" : false, // Web Workers
|
|
||||||
"wsh" : false, // Windows Scripting Host
|
|
||||||
"yui" : false, // Yahoo User Interface
|
|
||||||
|
|
||||||
// Custom Globals
|
|
||||||
"globals" : {
|
|
||||||
// jasmine helpers
|
|
||||||
"expect": false,
|
|
||||||
"describe": false,
|
|
||||||
"ddescribe": false,
|
|
||||||
"beforeEach": false,
|
|
||||||
"it": false,
|
|
||||||
"iit": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
19
.travis.yml
|
|
@ -1,5 +1,18 @@
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "0.12"
|
- "4"
|
||||||
- "0.10"
|
- "5"
|
||||||
- "iojs"
|
- "6"
|
||||||
|
env:
|
||||||
|
- WEBPACK_VERSION=1 EXTRACT_PLUGIN_VERSION=1
|
||||||
|
- WEBPACK_VERSION=2 EXTRACT_PLUGIN_VERSION=2
|
||||||
|
- WEBPACK_VERSION=3 EXTRACT_PLUGIN_VERSION=3.0.0-beta.3
|
||||||
|
before_install:
|
||||||
|
- stty columns 120
|
||||||
|
install:
|
||||||
|
- npm install --ignore-scripts
|
||||||
|
- npm rm webpack
|
||||||
|
- npm rm extract-text-webpack-plugin
|
||||||
|
- npm install webpack@$WEBPACK_VERSION extract-text-webpack-plugin@$EXTRACT_PLUGIN_VERSION --ignore-scripts || true
|
||||||
|
script:
|
||||||
|
- npm test
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,277 @@
|
||||||
|
Change History
|
||||||
|
==============
|
||||||
|
|
||||||
|
v2.30.1
|
||||||
|
---
|
||||||
|
* Revert part the performance optimization (#723) because of #753.
|
||||||
|
|
||||||
|
v2.30.0
|
||||||
|
---
|
||||||
|
* Add manual sort
|
||||||
|
* Performance improvements (#723)
|
||||||
|
|
||||||
|
v2.29.0
|
||||||
|
---
|
||||||
|
* Add support for Webpack 3
|
||||||
|
|
||||||
|
v2.28.0
|
||||||
|
---
|
||||||
|
* Backport 3.x void tag for plugin authors
|
||||||
|
|
||||||
|
v2.27.1
|
||||||
|
---
|
||||||
|
* Revert 2.25.0 loader resolving
|
||||||
|
|
||||||
|
v2.27.0
|
||||||
|
---
|
||||||
|
* Fix a chunksorter webpack 2 issue (#569)
|
||||||
|
* Fix template path resolving(#542)
|
||||||
|
|
||||||
|
v2.26.0
|
||||||
|
---
|
||||||
|
* Allow plugins to add attributes without values to the `<script>` and `<link>` tags
|
||||||
|
|
||||||
|
v2.25.0
|
||||||
|
---
|
||||||
|
* Clearer loader output
|
||||||
|
* Add basic support for webpack 2
|
||||||
|
|
||||||
|
v2.24.1
|
||||||
|
---
|
||||||
|
* Hide event deprecated warning of 'applyPluginsAsyncWaterfall' for html-webpack-plugin-after-emit and improve the warning message.
|
||||||
|
|
||||||
|
v2.24.0
|
||||||
|
---
|
||||||
|
* Update dependencies
|
||||||
|
* Add deprecate warning for plugins not returning a result
|
||||||
|
* Add [path] for favicons
|
||||||
|
|
||||||
|
v2.23.0
|
||||||
|
---
|
||||||
|
* Update dependencies
|
||||||
|
* Stop automated tests for webpack 2 beta because of #401
|
||||||
|
|
||||||
|
v2.22.0
|
||||||
|
---
|
||||||
|
* Update dependencies
|
||||||
|
|
||||||
|
v2.21.1
|
||||||
|
---
|
||||||
|
* Better error handling (#354)
|
||||||
|
|
||||||
|
v2.21.0
|
||||||
|
----
|
||||||
|
* Add `html-webpack-plugin-alter-asset-tags` event to allow plugins to adjust the script/link tags
|
||||||
|
|
||||||
|
v2.20.0
|
||||||
|
----
|
||||||
|
* Exclude chunks works now even if combined with dependency sort
|
||||||
|
|
||||||
|
v2.19.0
|
||||||
|
----
|
||||||
|
* Add `html-webpack-plugin-alter-chunks` event for custom chunk sorting and interpolation
|
||||||
|
|
||||||
|
v2.18.0
|
||||||
|
----
|
||||||
|
* Updated all dependencies
|
||||||
|
|
||||||
|
v2.17.0
|
||||||
|
----
|
||||||
|
* Add `type` attribute to `script` element to prevent issues in Safari 9.1.1
|
||||||
|
|
||||||
|
v2.16.2
|
||||||
|
----
|
||||||
|
* Fix bug introduced by 2.16.2. Fixes #315
|
||||||
|
|
||||||
|
v2.16.1
|
||||||
|
----
|
||||||
|
* Fix hot module replacement for webpack 2.x
|
||||||
|
|
||||||
|
v2.16.0
|
||||||
|
----
|
||||||
|
* Add support for dynamic filenames like index[hash].html
|
||||||
|
|
||||||
|
v2.15.0
|
||||||
|
----
|
||||||
|
* Add full unit test coverage for the webpack 2 beta version
|
||||||
|
* For webpack 2 the default sort will be 'dependency' instead of 'id'
|
||||||
|
* Upgrade dependencies
|
||||||
|
|
||||||
|
v2.14.0
|
||||||
|
----
|
||||||
|
* Export publicPath to the template
|
||||||
|
* Add example for inlining css and js
|
||||||
|
|
||||||
|
v2.13.0
|
||||||
|
----
|
||||||
|
* Add support for absolute output file names
|
||||||
|
* Add support for relative file names outside the output path
|
||||||
|
|
||||||
|
v2.12.0
|
||||||
|
----
|
||||||
|
* Basic Webpack 2.x support #225
|
||||||
|
|
||||||
|
v2.11.0
|
||||||
|
----
|
||||||
|
* Add `xhtml` option which is turned of by default. When activated it will inject self closed `<link href=".." />` tags instead of unclosed `<link href="..">` tags. https://github.com/ampedandwired/html-webpack-plugin/pull/255
|
||||||
|
* Add support for webpack placeholders inside the public path e.g. `'/dist/[hash]/'`. https://github.com/ampedandwired/html-webpack-plugin/pull/249
|
||||||
|
|
||||||
|
v2.10.0
|
||||||
|
----
|
||||||
|
* Add `hash` field to the chunk object
|
||||||
|
* Add `compilation` field to the templateParam object (fixes https://github.com/ampedandwired/html-webpack-plugin/issues/237)
|
||||||
|
* Add `html-webpack-plugin-before-html-generation` event
|
||||||
|
* Improve error messages
|
||||||
|
|
||||||
|
v2.9.0
|
||||||
|
----
|
||||||
|
* Fix favicon path (fixes https://github.com/ampedandwired/html-webpack-plugin/issues/185, https://github.com/ampedandwired/html-webpack-plugin/issues/208, https://github.com/ampedandwired/html-webpack-plugin/pull/215 )
|
||||||
|
|
||||||
|
v2.8.2
|
||||||
|
----
|
||||||
|
* Support relative URLs on Windows (fixes https://github.com/ampedandwired/html-webpack-plugin/issues/205 )
|
||||||
|
|
||||||
|
v2.8.1
|
||||||
|
----
|
||||||
|
* Caching improvements (fixes https://github.com/ampedandwired/html-webpack-plugin/issues/204 )
|
||||||
|
|
||||||
|
v2.8.0
|
||||||
|
----
|
||||||
|
* Add `dependency` mode for `chunksSortMode` to sort chunks based on their dependencies with each other
|
||||||
|
|
||||||
|
v2.7.2
|
||||||
|
----
|
||||||
|
* Add support for require in js templates
|
||||||
|
|
||||||
|
v2.7.1
|
||||||
|
----
|
||||||
|
* Refactoring
|
||||||
|
* Fix relative windows path
|
||||||
|
|
||||||
|
v2.6.5
|
||||||
|
----
|
||||||
|
* Minor refactoring
|
||||||
|
|
||||||
|
v2.6.4
|
||||||
|
----
|
||||||
|
* Fix for `"Uncaught TypeError: __webpack_require__(...) is not a function"`
|
||||||
|
* Fix incomplete cache modules causing "HtmlWebpackPlugin Error: No source available"
|
||||||
|
* Fix some issues on Windows
|
||||||
|
|
||||||
|
v2.6.3
|
||||||
|
----
|
||||||
|
* Prevent parsing the base template with the html-loader
|
||||||
|
|
||||||
|
v2.6.2
|
||||||
|
----
|
||||||
|
* Fix `lodash` resolve error (fixes https://github.com/ampedandwired/html-webpack-plugin/issues/172 )
|
||||||
|
|
||||||
|
v2.6.1
|
||||||
|
----
|
||||||
|
* Fix missing module (fixes https://github.com/ampedandwired/html-webpack-plugin/issues/164 )
|
||||||
|
|
||||||
|
v2.6.0
|
||||||
|
----
|
||||||
|
* Move compiler to its own file
|
||||||
|
* Improve error messages
|
||||||
|
* Fix global HTML_WEBPACK_PLUGIN variable
|
||||||
|
|
||||||
|
v2.5.0
|
||||||
|
----
|
||||||
|
* Support `lodash` template's HTML _"escape"_ delimiter (`<%- %>`)
|
||||||
|
* Fix bluebird warning (fixes https://github.com/ampedandwired/html-webpack-plugin/issues/130 )
|
||||||
|
* Fix an issue where incomplete cache modules were used
|
||||||
|
|
||||||
|
v2.4.0
|
||||||
|
----
|
||||||
|
* Don't recompile if the assets didn't change
|
||||||
|
|
||||||
|
v2.3.0
|
||||||
|
----
|
||||||
|
* Add events `html-webpack-plugin-before-html-processing`, `html-webpack-plugin-after-html-processing`, `html-webpack-plugin-after-emit` to allow other plugins to alter the html this plugin executes
|
||||||
|
|
||||||
|
v2.2.0
|
||||||
|
----
|
||||||
|
* Inject css and js even if the html file is incomplete (fixes https://github.com/ampedandwired/html-webpack-plugin/issues/135 )
|
||||||
|
* Update dependencies
|
||||||
|
|
||||||
|
v2.1.0
|
||||||
|
----
|
||||||
|
* Synchronize with the stable `@1` version
|
||||||
|
|
||||||
|
v2.0.4
|
||||||
|
----
|
||||||
|
* Fix `minify` option
|
||||||
|
* Fix missing hash interpolation in publicPath
|
||||||
|
|
||||||
|
v2.0.3
|
||||||
|
----
|
||||||
|
* Add support for webpack.BannerPlugin
|
||||||
|
|
||||||
|
v2.0.2
|
||||||
|
----
|
||||||
|
* Add support for loaders in templates (fixes https://github.com/ampedandwired/html-webpack-plugin/pull/41 )
|
||||||
|
* Remove `templateContent` option from configuration
|
||||||
|
* Better error messages
|
||||||
|
* Update dependencies
|
||||||
|
|
||||||
|
|
||||||
|
v1.7.0
|
||||||
|
----
|
||||||
|
* Add `chunksSortMode` option to configuration to control how chunks should be sorted before they are included to the html
|
||||||
|
* Don't insert async chunks into html (fixes https://github.com/ampedandwired/html-webpack-plugin/issues/95 )
|
||||||
|
* Update dependencies
|
||||||
|
|
||||||
|
v1.6.2
|
||||||
|
----
|
||||||
|
* Fix paths on Windows
|
||||||
|
* Fix missing hash interpolation in publicPath
|
||||||
|
* Allow only `false` or `object` in `minify` configuration option
|
||||||
|
|
||||||
|
v1.6.1
|
||||||
|
----
|
||||||
|
* Add `size` field to the chunk object
|
||||||
|
* Fix stylesheet `<link>`s being discarded when used with `"inject: 'head'"`
|
||||||
|
* Update dependencies
|
||||||
|
|
||||||
|
v1.6.0
|
||||||
|
----
|
||||||
|
* Support placing templates in subfolders
|
||||||
|
* Don't include chunks with undefined name (fixes https://github.com/ampedandwired/html-webpack-plugin/pull/60 )
|
||||||
|
* Don't include async chunks
|
||||||
|
|
||||||
|
v1.5.2
|
||||||
|
----
|
||||||
|
* Update dependencies (lodash)
|
||||||
|
|
||||||
|
v1.5.1
|
||||||
|
----
|
||||||
|
* Fix error when manifest is specified (fixes https://github.com/ampedandwired/html-webpack-plugin/issues/56 )
|
||||||
|
|
||||||
|
v1.5.0
|
||||||
|
----
|
||||||
|
* Allow to inject javascript files into the head of the html page
|
||||||
|
* Fix error reporting
|
||||||
|
|
||||||
|
v1.4.0
|
||||||
|
----
|
||||||
|
* Add `favicon.ico` option
|
||||||
|
* Add html minifcation
|
||||||
|
|
||||||
|
v1.2.0
|
||||||
|
------
|
||||||
|
* Set charset using HTML5 meta attribute
|
||||||
|
* Reload upon change when using webpack watch mode
|
||||||
|
* Generate manifest attribute when using
|
||||||
|
[appcache-webpack-plugin](https://github.com/lettertwo/appcache-webpack-plugin)
|
||||||
|
* Optionally add webpack hash as a query string to resources included in the HTML
|
||||||
|
(`hash: true`) for cache busting
|
||||||
|
* CSS files generated using webpack (for example, by using the
|
||||||
|
[extract-text-webpack-plugin](https://github.com/webpack/extract-text-webpack-plugin))
|
||||||
|
are now automatically included into the generated HTML
|
||||||
|
* More detailed information about the files generated by webpack is now available
|
||||||
|
to templates in the `o.htmlWebpackPlugin.files` attribute. See readme for more
|
||||||
|
details. This new attribute deprecates the old `o.htmlWebpackPlugin.assets` attribute.
|
||||||
|
* The `templateContent` option can now be a function that returns the template string to use
|
||||||
|
* Expose webpack configuration to templates (`o.webpackConfig`)
|
||||||
|
* Sort chunks to honour dependencies between them (useful for use with CommonsChunkPlugin).
|
||||||
25
CHANGES.md
|
|
@ -1,25 +0,0 @@
|
||||||
Change History
|
|
||||||
==============
|
|
||||||
|
|
||||||
v1.4.0
|
|
||||||
----
|
|
||||||
* Add `favicon.ico` option
|
|
||||||
* Add html minifcation
|
|
||||||
|
|
||||||
v1.2.0
|
|
||||||
------
|
|
||||||
* Set charset using HTML5 meta attribute
|
|
||||||
* Reload upon change when using webpack watch mode
|
|
||||||
* Generate manifest attribute when using
|
|
||||||
[appcache-webpack-plugin](https://github.com/lettertwo/appcache-webpack-plugin)
|
|
||||||
* Optionally add webpack hash as a query string to resources included in the HTML
|
|
||||||
(`hash: true`) for cache busting
|
|
||||||
* CSS files generated using webpack (for example, by using the
|
|
||||||
[extract-text-webpack-plugin](https://github.com/webpack/extract-text-webpack-plugin))
|
|
||||||
are now automatically included into the generated HTML
|
|
||||||
* More detailed information about the files generated by webpack is now available
|
|
||||||
to templates in the `o.htmlWebpackPlugin.files` attribute. See readme for more
|
|
||||||
details. This new attribute deprecates the old `o.htmlWebpackPlugin.assets` attribute.
|
|
||||||
* The `templateContent` option can now be a function that returns the template string to use
|
|
||||||
* Expose webpack configuration to templates (`o.webpackConfig`)
|
|
||||||
* Sort chunks to honour dependencies between them (useful for use with CommonsChunkPlugin).
|
|
||||||
177
README.md
|
|
@ -1,19 +1,44 @@
|
||||||
HTML Webpack Plugin
|
HTML Webpack Plugin
|
||||||
===================
|
===================
|
||||||
[](http://badge.fury.io/js/html-webpack-plugin) [](https://david-dm.org/ampedandwired/html-webpack-plugin) [](https://www.bithound.io/github/ampedandwired/html-webpack-plugin) [](https://travis-ci.org/ampedandwired/html-webpack-plugin)
|
[](http://badge.fury.io/js/html-webpack-plugin) [](https://david-dm.org/jantimon/html-webpack-plugin) [](https://travis-ci.org/jantimon/html-webpack-plugin) [](https://ci.appveyor.com/project/jantimon/html-webpack-plugin) [](https://github.com/Flet/semistandard) [](https://www.bithound.io/github/jantimon/html-webpack-plugin/master/dependencies/npm) []()
|
||||||
|
|
||||||
|
[](https://nodei.co/npm/html-webpack-plugin/)
|
||||||
|
|
||||||
This is a [webpack](http://webpack.github.io/) plugin that simplifies creation of HTML files to serve your
|
This is a [webpack](http://webpack.github.io/) plugin that simplifies creation of HTML files to serve your
|
||||||
webpack bundles. This is especially useful for webpack bundles that include
|
webpack bundles. This is especially useful for webpack bundles that include
|
||||||
a hash in the filename which changes every compilation. You can either let the plugin generate an HTML file for you, supply
|
a hash in the filename which changes every compilation. You can either let the plugin generate an HTML file for you, supply
|
||||||
your own template using lodash templates or use your own loader.
|
your own template using lodash templates or use your own loader.
|
||||||
|
|
||||||
|
Maintainer: Jan Nicklas [@jantimon](https://twitter.com/jantimon) and Thomas Sileghem [@mastilver](https://twitter.com/mastilver)
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
Install the plugin with npm:
|
Install the plugin with npm:
|
||||||
```shell
|
```shell
|
||||||
$ npm install html-webpack-plugin@2 --save-dev
|
$ npm install html-webpack-plugin --save-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Third party addons:
|
||||||
|
-------------
|
||||||
|
|
||||||
|
The html-webpack-plugin provides [hooks](https://github.com/jantimon/html-webpack-plugin#events) to extend it to your needs.
|
||||||
|
There are already some really powerful plugins which can be integrated with zero configuration:
|
||||||
|
|
||||||
|
* [webpack-subresource-integrity](https://www.npmjs.com/package/webpack-subresource-integrity) for enhanced asset security
|
||||||
|
* [appcache-webpack-plugin](https://github.com/lettertwo/appcache-webpack-plugin) for iOS and Android offline usage
|
||||||
|
* [favicons-webpack-plugin](https://github.com/jantimon/favicons-webpack-plugin) which generates favicons and icons for iOS, Android and desktop browsers
|
||||||
|
* [html-webpack-harddisk-plugin](https://github.com/jantimon/html-webpack-harddisk-plugin) can be used to always write to disk the html file, useful when webpack-dev-server / HMR are being used
|
||||||
|
* [html-webpack-inline-source-plugin](https://github.com/DustinJackson/html-webpack-inline-source-plugin) to inline your assets in the resulting HTML file
|
||||||
|
* [html-webpack-inline-svg-plugin](https://github.com/thegc/html-webpack-inline-svg-plugin) to inline SVGs in the resulting HTML file.
|
||||||
|
* [html-webpack-exclude-assets-plugin](https://github.com/jamesjieye/html-webpack-exclude-assets-plugin) for excluding assets using regular expressions
|
||||||
|
* [html-webpack-include-assets-plugin](https://github.com/jharris4/html-webpack-include-assets-plugin) for including lists of js or css file paths (such as those copied by the copy-webpack-plugin).
|
||||||
|
* [script-ext-html-webpack-plugin](https://github.com/numical/script-ext-html-webpack-plugin) to add `async`, `defer` or `module` attributes to your`<script>` elements, or even in-line them
|
||||||
|
* [style-ext-html-webpack-plugin](https://github.com/numical/style-ext-html-webpack-plugin) to convert your `<link>`s to external stylesheets into `<style>` elements containing internal CSS
|
||||||
|
* [resource-hints-webpack-plugin](https://github.com/jantimon/resource-hints-webpack-plugin) to add resource hints for faster initial page loads using `<link rel='preload'>` and `<link rel='prefetch'>`
|
||||||
|
* [preload-webpack-plugin](https://github.com/GoogleChrome/preload-webpack-plugin) for automatically wiring up asynchronous (and other types) of JavaScript chunks using `<link rel='preload'>` helping with lazy-loading
|
||||||
|
* [link-media-html-webpack-plugin](https://github.com/yaycmyk/link-media-html-webpack-plugin) allows for injected stylesheet `<link />` tags to have their media attribute set automatically; useful for providing specific desktop/mobile/print etc. stylesheets that the browser will conditionally download
|
||||||
|
* [inline-chunk-manifest-html-webpack-plugin](https://github.com/jouni-kantola/inline-chunk-manifest-html-webpack-plugin) for inlining webpack's chunk manifest. Default extracts manifest and inlines in `<head>`.
|
||||||
|
|
||||||
Basic Usage
|
Basic Usage
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
|
@ -22,15 +47,15 @@ bundles in the body using `script` tags. Just add the plugin to your webpack
|
||||||
config as follows:
|
config as follows:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var HtmlWebpackPlugin = require('html-webpack-plugin')
|
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
var webpackConfig = {
|
var webpackConfig = {
|
||||||
entry: 'index.js',
|
entry: 'index.js',
|
||||||
output: {
|
output: {
|
||||||
path: 'dist',
|
path: __dirname + '/dist',
|
||||||
filename: 'index_bundle.js'
|
filename: 'index_bundle.js'
|
||||||
},
|
},
|
||||||
plugins: [new HtmlWebpackPlugin()]
|
plugins: [new HtmlWebpackPlugin()]
|
||||||
}
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
This will generate a file `dist/index.html` containing the following:
|
This will generate a file `dist/index.html` containing the following:
|
||||||
|
|
@ -50,7 +75,7 @@ This will generate a file `dist/index.html` containing the following:
|
||||||
If you have multiple webpack entry points, they will all be included with `script`
|
If you have multiple webpack entry points, they will all be included with `script`
|
||||||
tags in the generated HTML.
|
tags in the generated HTML.
|
||||||
|
|
||||||
If you have any css assets in webpack's output (for example, css extracted
|
If you have any CSS assets in webpack's output (for example, CSS extracted
|
||||||
with the [ExtractTextPlugin](https://github.com/webpack/extract-text-webpack-plugin))
|
with the [ExtractTextPlugin](https://github.com/webpack/extract-text-webpack-plugin))
|
||||||
then these will be included with `<link>` tags in the HTML head.
|
then these will be included with `<link>` tags in the HTML head.
|
||||||
|
|
||||||
|
|
@ -62,26 +87,26 @@ Allowed values are as follows:
|
||||||
- `title`: The title to use for the generated HTML document.
|
- `title`: The title to use for the generated HTML document.
|
||||||
- `filename`: The file to write the HTML to. Defaults to `index.html`.
|
- `filename`: The file to write the HTML to. Defaults to `index.html`.
|
||||||
You can specify a subdirectory here too (eg: `assets/admin.html`).
|
You can specify a subdirectory here too (eg: `assets/admin.html`).
|
||||||
- `template`: Path to the template. Supports loaders e.g. `html!./index.html`.
|
- `template`: Webpack require path to the template. Please see the [docs](https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md) for details.
|
||||||
- `inject`: `true | 'head' | 'body' | false` Inject all assets into the given `template` or `templateContent` - When passing `true` or `'body'` all javascript resources will be placed at the bottom of the body element. `'head'` will place the scripts in the head element.
|
- `inject`: `true | 'head' | 'body' | false` Inject all assets into the given `template` or `templateContent` - When passing `true` or `'body'` all javascript resources will be placed at the bottom of the body element. `'head'` will place the scripts in the head element.
|
||||||
- `favicon`: Adds the given favicon path to the output html.
|
- `favicon`: Adds the given favicon path to the output html.
|
||||||
- `minify`: `{...} | false` Pass a [html-minifier](https://github.com/kangax/html-minifier#options-quick-reference) options object to minify the output.
|
- `minify`: `{...} | false` Pass [html-minifier](https://github.com/kangax/html-minifier#options-quick-reference)'s options as object to minify the output.
|
||||||
- `hash`: `true | false` if `true` then append a unique webpack compilation hash to all
|
- `hash`: `true | false` if `true` then append a unique webpack compilation hash to all
|
||||||
included scripts and css files. This is useful for cache busting.
|
included scripts and CSS files. This is useful for cache busting.
|
||||||
- `cache`: `true | false` if `true` (default) try to emit the file only if it was changed.
|
- `cache`: `true | false` if `true` (default) try to emit the file only if it was changed.
|
||||||
- `showErrors`: `true | false` if `true` (default) errors details will be written into the html page.
|
- `showErrors`: `true | false` if `true` (default) errors details will be written into the HTML page.
|
||||||
- `chunks`: Allows you to add only some chunks (e.g. only the unit-test chunk)
|
- `chunks`: Allows you to add only some chunks (e.g. only the unit-test chunk)
|
||||||
- `chunksSortMode`: Allows to controll how chunks should be sorted before they are included to the html. Allowed values: 'none' | 'default' | {function} - default: 'auto'
|
- `chunksSortMode`: Allows to control how chunks should be sorted before they are included to the html. Allowed values: 'none' | 'auto' | 'dependency' |'manual' | {function} - default: 'auto'
|
||||||
- `excludeChunks`: Allows you to skip some chunks (e.g. don't add the unit-test chunk)
|
- `excludeChunks`: Allows you to skip some chunks (e.g. don't add the unit-test chunk)
|
||||||
|
- `xhtml`: `true | false` If `true` render the `link` tags as self-closing, XHTML compliant. Default is `false`
|
||||||
|
|
||||||
Here's an example webpack config illustrating how to use these options:
|
Here's an example webpack config illustrating how to use these options:
|
||||||
```javascript
|
```javascript
|
||||||
{
|
{
|
||||||
entry: 'index.js',
|
entry: 'index.js',
|
||||||
output: {
|
output: {
|
||||||
path: 'dist',
|
path: __dirname + '/dist',
|
||||||
filename: 'index_bundle.js',
|
filename: 'index_bundle.js'
|
||||||
hash: true
|
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
|
|
@ -92,6 +117,13 @@ Here's an example webpack config illustrating how to use these options:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
FAQ
|
||||||
|
----
|
||||||
|
|
||||||
|
* [Why is my HTML minified?](https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md)
|
||||||
|
* [Why is my `<% ... %>` template not working?](https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md)
|
||||||
|
* [How can I use handlebars/pug/ejs as template engine](https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md)
|
||||||
|
|
||||||
Generating Multiple HTML Files
|
Generating Multiple HTML Files
|
||||||
------------------------------
|
------------------------------
|
||||||
To generate more than one HTML file, declare the plugin more than
|
To generate more than one HTML file, declare the plugin more than
|
||||||
|
|
@ -100,7 +132,7 @@ once in your plugins array:
|
||||||
{
|
{
|
||||||
entry: 'index.js',
|
entry: 'index.js',
|
||||||
output: {
|
output: {
|
||||||
path: 'dist',
|
path: __dirname + '/dist',
|
||||||
filename: 'index_bundle.js'
|
filename: 'index_bundle.js'
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|
@ -116,21 +148,20 @@ once in your plugins array:
|
||||||
Writing Your Own Templates
|
Writing Your Own Templates
|
||||||
--------------------------
|
--------------------------
|
||||||
If the default generated HTML doesn't meet your needs you can supply
|
If the default generated HTML doesn't meet your needs you can supply
|
||||||
your own template. The easiest way is to use the `inject` option and pass a custom html file.
|
your own template. The easiest way is to use the `template` option and pass a custom HTML file.
|
||||||
The html-webpack-plugin will automatically inject all necessary css, js, manifest
|
The html-webpack-plugin will automatically inject all necessary CSS, JS, manifest
|
||||||
and favicon files into the markup.
|
and favicon files into the markup.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
plugins: [
|
plugins: [
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
title: 'Custom template',
|
title: 'Custom template',
|
||||||
template: 'my-index.html', // Load a custom template
|
template: 'my-index.ejs', // Load a custom template (ejs by default see the FAQ for details)
|
||||||
inject: 'body' // Inject all scripts into the body
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
`my-index.html`:
|
`my-index.ejs`:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
@ -145,6 +176,7 @@ plugins: [
|
||||||
```
|
```
|
||||||
|
|
||||||
If you already have a template loader, you can use it to parse the template.
|
If you already have a template loader, you can use it to parse the template.
|
||||||
|
Please note that this will also happen if you specifiy the html-loader and use `.html` file as template.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
module: {
|
module: {
|
||||||
|
|
@ -155,55 +187,15 @@ module: {
|
||||||
plugins: [
|
plugins: [
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
title: 'Custom template using Handlebars',
|
title: 'Custom template using Handlebars',
|
||||||
template: 'my-index.hbs',
|
template: 'my-index.hbs'
|
||||||
inject: 'body'
|
|
||||||
})
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, if you already have your template's content in a String, you
|
|
||||||
can pass it to the plugin using the `templateContent` option:
|
|
||||||
```javascript
|
|
||||||
plugins: [
|
|
||||||
new HtmlWebpackPlugin({
|
|
||||||
inject: true,
|
|
||||||
templateContent: templateContentString
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
You can use the lodash syntax out of the box.
|
You can use the lodash syntax out of the box.
|
||||||
If the `inject` feature doesn't fit your needs and you want full control over the asset placement use the [default template](https://github.com/ampedandwired/html-webpack-plugin/blob/feature/loaders/default_index.html)
|
If the `inject` feature doesn't fit your needs and you want full control over the asset placement use the [default template](https://github.com/jaketrent/html-webpack-template/blob/86f285d5c790a6c15263f5cc50fd666d51f974fd/index.html) of the [html-webpack-template project](https://github.com/jaketrent/html-webpack-template) as a starting point for writing your own.
|
||||||
as a starting point for writing your own.
|
|
||||||
|
|
||||||
The `templateContent` option can also be a function to use another template language like jade:
|
The following variables are available in the template:
|
||||||
```javascript
|
|
||||||
plugins: [
|
|
||||||
new HtmlWebpackPlugin({
|
|
||||||
templateContent: function(templateParams, compilation) {
|
|
||||||
// Return your template content synchronously here
|
|
||||||
return '..';
|
|
||||||
}
|
|
||||||
})
|
|
||||||
]
|
|
||||||
```
|
|
||||||
Or the async version:
|
|
||||||
```javascript
|
|
||||||
plugins: [
|
|
||||||
new HtmlWebpackPlugin({
|
|
||||||
templateContent: function(templateParams, compilation, callback) {
|
|
||||||
// Return your template content asynchronously here
|
|
||||||
callback(null, '..');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
Note the plugin will throw an error if you specify both `template` _and_
|
|
||||||
`templateContent`.
|
|
||||||
|
|
||||||
The `o` variable in the template is the data that is passed in when the
|
|
||||||
template is rendered. This variable has the following attributes:
|
|
||||||
- `htmlWebpackPlugin`: data specific to this plugin
|
- `htmlWebpackPlugin`: data specific to this plugin
|
||||||
- `htmlWebpackPlugin.files`: a massaged representation of the
|
- `htmlWebpackPlugin.files`: a massaged representation of the
|
||||||
`assetsByChunkName` attribute of webpack's [stats](https://github.com/webpack/docs/wiki/node.js-api#stats)
|
`assetsByChunkName` attribute of webpack's [stats](https://github.com/webpack/docs/wiki/node.js-api#stats)
|
||||||
|
|
@ -236,7 +228,7 @@ template is rendered. This variable has the following attributes:
|
||||||
- `webpack`: the webpack [stats](https://github.com/webpack/docs/wiki/node.js-api#stats)
|
- `webpack`: the webpack [stats](https://github.com/webpack/docs/wiki/node.js-api#stats)
|
||||||
object. Note that this is the stats object as it was at the time the HTML template
|
object. Note that this is the stats object as it was at the time the HTML template
|
||||||
was emitted and as such may not have the full set of stats that are available
|
was emitted and as such may not have the full set of stats that are available
|
||||||
after the wepback run is complete.
|
after the webpack run is complete.
|
||||||
|
|
||||||
- `webpackConfig`: the webpack configuration that was used for this compilation. This
|
- `webpackConfig`: the webpack configuration that was used for this compilation. This
|
||||||
can be used, for example, to get the `publicPath` (`webpackConfig.output.publicPath`).
|
can be used, for example, to get the `publicPath` (`webpackConfig.output.publicPath`).
|
||||||
|
|
@ -268,17 +260,64 @@ plugins: [
|
||||||
Events
|
Events
|
||||||
------
|
------
|
||||||
|
|
||||||
To allow other plugins to alter the html this plugin executes the following events:
|
To allow other [plugins](https://github.com/webpack/docs/wiki/plugins) to alter the HTML this plugin executes the following events:
|
||||||
|
|
||||||
|
Async:
|
||||||
|
|
||||||
|
* `html-webpack-plugin-before-html-generation`
|
||||||
* `html-webpack-plugin-before-html-processing`
|
* `html-webpack-plugin-before-html-processing`
|
||||||
|
* `html-webpack-plugin-alter-asset-tags`
|
||||||
* `html-webpack-plugin-after-html-processing`
|
* `html-webpack-plugin-after-html-processing`
|
||||||
* `html-webpack-plugin-after-emit`
|
* `html-webpack-plugin-after-emit`
|
||||||
|
|
||||||
|
Sync:
|
||||||
|
|
||||||
|
* `html-webpack-plugin-alter-chunks`
|
||||||
|
|
||||||
|
Example implementation: [html-webpack-harddisk-plugin](https://github.com/jantimon/html-webpack-harddisk-plugin)
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
```
|
```javascript
|
||||||
compilation.plugin('html-webpack-plugin-before-html-processing', function(htmlPluginData, callback) {
|
// MyPlugin.js
|
||||||
htmlPluginData.html += 'The magic footer';
|
|
||||||
callback();
|
function MyPlugin(options) {
|
||||||
|
// Configure your plugin with options...
|
||||||
|
}
|
||||||
|
|
||||||
|
MyPlugin.prototype.apply = function(compiler) {
|
||||||
|
// ...
|
||||||
|
compiler.plugin('compilation', function(compilation) {
|
||||||
|
console.log('The compiler is starting a new compilation...');
|
||||||
|
|
||||||
|
compilation.plugin('html-webpack-plugin-before-html-processing', function(htmlPluginData, callback) {
|
||||||
|
htmlPluginData.html += 'The magic footer';
|
||||||
|
callback(null, htmlPluginData);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = MyPlugin;
|
||||||
```
|
```
|
||||||
|
Then in `webpack.config.js`
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
plugins: [
|
||||||
|
new MyPlugin({options: ''})
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that the callback must be passed the htmlPluginData in order to pass this onto any other plugins listening on the same `html-webpack-plugin-before-html-processing` event.
|
||||||
|
|
||||||
|
|
||||||
|
# Contribution
|
||||||
|
|
||||||
|
You're free to contribute to this project by submitting [issues](https://github.com/jantimon/html-webpack-plugin/issues) and/or [pull requests](https://github.com/jantimon/html-webpack-plugin/pulls). This project is test-driven, so keep in mind that every change and new feature should be covered by tests.
|
||||||
|
This project uses the [semistandard code style](https://github.com/Flet/semistandard).
|
||||||
|
|
||||||
|
Before running the tests, make sure to execute `yarn link` and `yarn link html-webpack-plugin` (or the npm variant of this).
|
||||||
|
|
||||||
|
# License
|
||||||
|
|
||||||
|
This project is licensed under [MIT](https://github.com/jantimon/html-webpack-plugin/blob/master/LICENSE).
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
# appveyor file
|
||||||
|
# http://www.appveyor.com/docs/appveyor-yml
|
||||||
|
|
||||||
|
environment:
|
||||||
|
matrix:
|
||||||
|
- nodejs_version: 0.10
|
||||||
|
- nodejs_version: 0.12
|
||||||
|
- nodejs_version: 4
|
||||||
|
|
||||||
|
version: "{build}"
|
||||||
|
build: off
|
||||||
|
deploy: off
|
||||||
|
matrix:
|
||||||
|
fast_finish: true
|
||||||
|
|
||||||
|
install:
|
||||||
|
- ps: Install-Product node $env:nodejs_version
|
||||||
|
- npm install
|
||||||
|
|
||||||
|
test_script:
|
||||||
|
- node --version
|
||||||
|
- npm --version
|
||||||
|
- npm test
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
# The template option
|
||||||
|
|
||||||
|
## History
|
||||||
|
|
||||||
|
The version 2.x which was introduced last year (Sep, 2015) changed the way the template is processed.
|
||||||
|
Instead of forcing all users to use the [blueimp](https://github.com/blueimp/JavaScript-Templates) template engine it allowed to use any webpack loader:
|
||||||
|
|
||||||
|
* [jade/pug](https://github.com/pugjs/pug-loader)
|
||||||
|
* [ejs](https://github.com/okonet/ejs-loader)
|
||||||
|
* [underscore](https://github.com/emaphp/underscore-template-loader)
|
||||||
|
* [handlebars](https://github.com/pcardune/handlebars-loader)
|
||||||
|
* [html-loader](https://github.com/webpack/html-loader)
|
||||||
|
* ...
|
||||||
|
|
||||||
|
Under the hood it is using a webpack child compilation which inherits all loaders from
|
||||||
|
your main configuration.
|
||||||
|
|
||||||
|
There are three ways to set the loader:
|
||||||
|
|
||||||
|
## 1) Don't set any loader
|
||||||
|
|
||||||
|
By default (if you don't specify any loader in any way) a [fallback ejs loader](https://github.com/ampedandwired/html-webpack-plugin/blob/master/lib/loader.js) kicks in.
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
plugins: [
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
template: 'src/index.ejs'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
It is a good idea to use `.ejs` instead of `.html` so you do not unexpectedly trigger another loader.
|
||||||
|
|
||||||
|
## 2) Setting a loader directly for the template
|
||||||
|
|
||||||
|
```js
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
// For details on `!!` see https://webpack.github.io/docs/loaders.html#loader-order
|
||||||
|
template: '!!handlebars!src/index.hbs'
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
## 3) Setting a loader using the `module.loaders` syntax
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
module: {
|
||||||
|
loaders: [
|
||||||
|
{
|
||||||
|
test: /\.hbs$/,
|
||||||
|
loader: 'handlebars-loader'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
template: 'src/index.hbs'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
However this also means that in the following example webpack will use the [html loader for your template](https://webpack.js.org/loaders/html-loader/).
|
||||||
|
This will **cause html minification** and it will also **disable the ejs fallback** loader.
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
module: {
|
||||||
|
loaders: [
|
||||||
|
{
|
||||||
|
test: /\.html$/,
|
||||||
|
loader: 'html-loader'
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
template: 'src/index.html'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -0,0 +1,60 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId])
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ exports: {},
|
||||||
|
/******/ id: moduleId,
|
||||||
|
/******/ loaded: false
|
||||||
|
/******/ };
|
||||||
|
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.loaded = true;
|
||||||
|
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
|
||||||
|
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(1);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<!doctype html><html lang="en" manifest="manifest.appcache"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><link href="styles.css" rel="stylesheet"></head><body><img src="0714810ae3fb211173e2964249507195.png"><script type="text/javascript" src="bundle.js"></script></body></html>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
CACHE MANIFEST
|
||||||
|
# f688cbdde5a6e721015e
|
||||||
|
|
||||||
|
0714810ae3fb211173e2964249507195.png
|
||||||
|
bundle.js
|
||||||
|
styles.css
|
||||||
|
|
||||||
|
NETWORK:
|
||||||
|
*
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -0,0 +1,86 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // identity function for calling harmony imports with the correct context
|
||||||
|
/******/ __webpack_require__.i = function(value) { return value; };
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(0);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<!doctype html><html lang="en" manifest="manifest.appcache"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><link href="styles.css" rel="stylesheet"></head><body><img src="0714810ae3fb211173e2964249507195.png"><script type="text/javascript" src="bundle.js"></script></body></html>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
CACHE MANIFEST
|
||||||
|
# 737de2033617f9f6144d
|
||||||
|
|
||||||
|
0714810ae3fb211173e2964249507195.png
|
||||||
|
bundle.js
|
||||||
|
styles.css
|
||||||
|
|
||||||
|
NETWORK:
|
||||||
|
*
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -0,0 +1,83 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(1);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<!doctype html><html lang="en" manifest="manifest.appcache"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><link href="styles.css" rel="stylesheet"></head><body><img src="0714810ae3fb211173e2964249507195.png"><script type="text/javascript" src="bundle.js"></script></body></html>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
CACHE MANIFEST
|
||||||
|
# eda37a6c6de5fd0ecfbe
|
||||||
|
|
||||||
|
0714810ae3fb211173e2964249507195.png
|
||||||
|
bundle.js
|
||||||
|
styles.css
|
||||||
|
|
||||||
|
NETWORK:
|
||||||
|
*
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
require('./main.css');
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Example template</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<img src="logo.png">
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
var path = require('path');
|
||||||
|
var AppCachePlugin = require('appcache-webpack-plugin');
|
||||||
|
var HtmlWebpackPlugin = require('../..');
|
||||||
|
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
|
var webpackMajorVersion = require('webpack/package.json').version.split('.')[0];
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
context: __dirname,
|
||||||
|
entry: './example.js',
|
||||||
|
output: {
|
||||||
|
path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion),
|
||||||
|
publicPath: '',
|
||||||
|
filename: 'bundle.js'
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
loaders: [
|
||||||
|
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') },
|
||||||
|
{ test: /\.png$/, loader: 'file-loader' },
|
||||||
|
{ test: /\.html$/, loader: 'html-loader?-removeOptionalTags' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new AppCachePlugin(),
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
filename: 'index.html',
|
||||||
|
template: 'template.html',
|
||||||
|
minify: {
|
||||||
|
removeComments: true,
|
||||||
|
collapseWhitespace: true
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new ExtractTextPlugin('styles.css')
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
/**
|
||||||
|
* This file is just a helper to compile all examples.
|
||||||
|
*
|
||||||
|
* You could do the same by going into each example and execute
|
||||||
|
* `webpack`
|
||||||
|
*/
|
||||||
|
var webpackMajorVersion = require('webpack/package.json').version.split('.')[0];
|
||||||
|
|
||||||
|
var fs = require('fs');
|
||||||
|
var path = require('path');
|
||||||
|
var rimraf = require('rimraf');
|
||||||
|
var webpack = require('webpack');
|
||||||
|
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
|
|
||||||
|
if (Number(webpackMajorVersion) > 1) {
|
||||||
|
var extractOriginal = ExtractTextPlugin.extract;
|
||||||
|
ExtractTextPlugin.extract = function (fallback, use) {
|
||||||
|
return extractOriginal({
|
||||||
|
fallback: fallback,
|
||||||
|
use: use
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var examples = fs.readdirSync(__dirname).filter(function (file) {
|
||||||
|
return fs.statSync(path.join(__dirname, file)).isDirectory();
|
||||||
|
});
|
||||||
|
|
||||||
|
examples.forEach(function (exampleName) {
|
||||||
|
var examplePath = path.join(__dirname, exampleName);
|
||||||
|
var configFile = path.join(examplePath, 'webpack.config.js');
|
||||||
|
|
||||||
|
rimraf.sync(path.join(examplePath, 'dist', 'webpack-' + webpackMajorVersion));
|
||||||
|
webpack(require(configFile), function (err, stats) {
|
||||||
|
if (err) {
|
||||||
|
console.error(err.stack || err);
|
||||||
|
if (err.details) {
|
||||||
|
console.error(err.details);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const info = stats.toJson();
|
||||||
|
|
||||||
|
if (stats.hasErrors()) {
|
||||||
|
console.error(info.errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stats.hasWarnings()) {
|
||||||
|
console.warn(info.warnings);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
BIN
examples/custom-template/dist/webpack-1/0714810ae3fb211173e2964249507195.png
vendored
Normal file
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -0,0 +1,60 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId])
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ exports: {},
|
||||||
|
/******/ id: moduleId,
|
||||||
|
/******/ loaded: false
|
||||||
|
/******/ };
|
||||||
|
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.loaded = true;
|
||||||
|
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
|
||||||
|
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(1);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Webpack App</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link href="styles.css" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<h2>Partial</h2>
|
||||||
|
<img src="0714810ae3fb211173e2964249507195.png">
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
BIN
examples/custom-template/dist/webpack-2/0714810ae3fb211173e2964249507195.png
vendored
Normal file
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -0,0 +1,86 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // identity function for calling harmony imports with the correct context
|
||||||
|
/******/ __webpack_require__.i = function(value) { return value; };
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(0);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Webpack App</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link href="styles.css" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<h2>Partial</h2>
|
||||||
|
<img src="0714810ae3fb211173e2964249507195.png">
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
BIN
examples/custom-template/dist/webpack-3/0714810ae3fb211173e2964249507195.png
vendored
Normal file
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -0,0 +1,83 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(1);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Webpack App</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link href="styles.css" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<h2>Partial</h2>
|
||||||
|
<img src="0714810ae3fb211173e2964249507195.png">
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
require('./main.css');
|
require('./main.css');
|
||||||
var h1 = document.createElement('h1');
|
var h1 = document.createElement('h1');
|
||||||
h1.innerHTML = 'Hello world!';
|
h1.innerHTML = 'Hello world!';
|
||||||
document.body.appendChild(h1);
|
document.body.appendChild(h1);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,6 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<%= require('html!./partial.html') %>
|
<%= require('html-loader!./partial.html') %>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
|
var path = require('path');
|
||||||
var HtmlWebpackPlugin = require('../..');
|
var HtmlWebpackPlugin = require('../..');
|
||||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
|
var webpackMajorVersion = require('webpack/package.json').version.split('.')[0];
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
context: __dirname,
|
||||||
entry: './example.js',
|
entry: './example.js',
|
||||||
output: {
|
output: {
|
||||||
path: __dirname + '/dist',
|
path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion),
|
||||||
publicPath: '',
|
publicPath: '',
|
||||||
filename: 'bundle.js'
|
filename: 'bundle.js'
|
||||||
},
|
},
|
||||||
|
|
@ -19,4 +23,4 @@ module.exports = {
|
||||||
}),
|
}),
|
||||||
new ExtractTextPlugin('styles.css')
|
new ExtractTextPlugin('styles.css')
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,402 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId])
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ exports: {},
|
||||||
|
/******/ id: moduleId,
|
||||||
|
/******/ loaded: false
|
||||||
|
/******/ };
|
||||||
|
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.loaded = true;
|
||||||
|
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
|
||||||
|
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(1);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
||||||
|
|
||||||
|
// load the styles
|
||||||
|
var content = __webpack_require__(2);
|
||||||
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
||||||
|
// add the styles to the DOM
|
||||||
|
var update = __webpack_require__(4)(content, {});
|
||||||
|
if(content.locals) module.exports = content.locals;
|
||||||
|
// Hot Module Replacement
|
||||||
|
if(false) {
|
||||||
|
// When the styles change, update the <style> tags
|
||||||
|
if(!content.locals) {
|
||||||
|
module.hot.accept("!!../../node_modules/css-loader/index.js!./main.css", function() {
|
||||||
|
var newContent = require("!!../../node_modules/css-loader/index.js!./main.css");
|
||||||
|
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
||||||
|
update(newContent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// When the module is disposed, remove the <style> tags
|
||||||
|
module.hot.dispose(function() { update(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 2 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
exports = module.exports = __webpack_require__(3)();
|
||||||
|
// imports
|
||||||
|
|
||||||
|
|
||||||
|
// module
|
||||||
|
exports.push([module.id, "body {\n background: snow;\n}", ""]);
|
||||||
|
|
||||||
|
// exports
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 3 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||||
|
Author Tobias Koppers @sokra
|
||||||
|
*/
|
||||||
|
// css base code, injected by the css-loader
|
||||||
|
module.exports = function() {
|
||||||
|
var list = [];
|
||||||
|
|
||||||
|
// return the list of modules as css string
|
||||||
|
list.toString = function toString() {
|
||||||
|
var result = [];
|
||||||
|
for(var i = 0; i < this.length; i++) {
|
||||||
|
var item = this[i];
|
||||||
|
if(item[2]) {
|
||||||
|
result.push("@media " + item[2] + "{" + item[1] + "}");
|
||||||
|
} else {
|
||||||
|
result.push(item[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.join("");
|
||||||
|
};
|
||||||
|
|
||||||
|
// import a list of modules into the list
|
||||||
|
list.i = function(modules, mediaQuery) {
|
||||||
|
if(typeof modules === "string")
|
||||||
|
modules = [[null, modules, ""]];
|
||||||
|
var alreadyImportedModules = {};
|
||||||
|
for(var i = 0; i < this.length; i++) {
|
||||||
|
var id = this[i][0];
|
||||||
|
if(typeof id === "number")
|
||||||
|
alreadyImportedModules[id] = true;
|
||||||
|
}
|
||||||
|
for(i = 0; i < modules.length; i++) {
|
||||||
|
var item = modules[i];
|
||||||
|
// skip already imported module
|
||||||
|
// this implementation is not 100% perfect for weird media query combinations
|
||||||
|
// when a module is imported multiple times with different media queries.
|
||||||
|
// I hope this will never occur (Hey this way we have smaller bundles)
|
||||||
|
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
|
||||||
|
if(mediaQuery && !item[2]) {
|
||||||
|
item[2] = mediaQuery;
|
||||||
|
} else if(mediaQuery) {
|
||||||
|
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
|
||||||
|
}
|
||||||
|
list.push(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return list;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 4 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||||
|
Author Tobias Koppers @sokra
|
||||||
|
*/
|
||||||
|
var stylesInDom = {},
|
||||||
|
memoize = function(fn) {
|
||||||
|
var memo;
|
||||||
|
return function () {
|
||||||
|
if (typeof memo === "undefined") memo = fn.apply(this, arguments);
|
||||||
|
return memo;
|
||||||
|
};
|
||||||
|
},
|
||||||
|
isOldIE = memoize(function() {
|
||||||
|
return /msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase());
|
||||||
|
}),
|
||||||
|
getHeadElement = memoize(function () {
|
||||||
|
return document.head || document.getElementsByTagName("head")[0];
|
||||||
|
}),
|
||||||
|
singletonElement = null,
|
||||||
|
singletonCounter = 0,
|
||||||
|
styleElementsInsertedAtTop = [];
|
||||||
|
|
||||||
|
module.exports = function(list, options) {
|
||||||
|
if(false) {
|
||||||
|
if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
|
||||||
|
}
|
||||||
|
|
||||||
|
options = options || {};
|
||||||
|
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
|
||||||
|
// tags it will allow on a page
|
||||||
|
if (typeof options.singleton === "undefined") options.singleton = isOldIE();
|
||||||
|
|
||||||
|
// By default, add <style> tags to the bottom of <head>.
|
||||||
|
if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
|
||||||
|
|
||||||
|
var styles = listToStyles(list);
|
||||||
|
addStylesToDom(styles, options);
|
||||||
|
|
||||||
|
return function update(newList) {
|
||||||
|
var mayRemove = [];
|
||||||
|
for(var i = 0; i < styles.length; i++) {
|
||||||
|
var item = styles[i];
|
||||||
|
var domStyle = stylesInDom[item.id];
|
||||||
|
domStyle.refs--;
|
||||||
|
mayRemove.push(domStyle);
|
||||||
|
}
|
||||||
|
if(newList) {
|
||||||
|
var newStyles = listToStyles(newList);
|
||||||
|
addStylesToDom(newStyles, options);
|
||||||
|
}
|
||||||
|
for(var i = 0; i < mayRemove.length; i++) {
|
||||||
|
var domStyle = mayRemove[i];
|
||||||
|
if(domStyle.refs === 0) {
|
||||||
|
for(var j = 0; j < domStyle.parts.length; j++)
|
||||||
|
domStyle.parts[j]();
|
||||||
|
delete stylesInDom[domStyle.id];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function addStylesToDom(styles, options) {
|
||||||
|
for(var i = 0; i < styles.length; i++) {
|
||||||
|
var item = styles[i];
|
||||||
|
var domStyle = stylesInDom[item.id];
|
||||||
|
if(domStyle) {
|
||||||
|
domStyle.refs++;
|
||||||
|
for(var j = 0; j < domStyle.parts.length; j++) {
|
||||||
|
domStyle.parts[j](item.parts[j]);
|
||||||
|
}
|
||||||
|
for(; j < item.parts.length; j++) {
|
||||||
|
domStyle.parts.push(addStyle(item.parts[j], options));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var parts = [];
|
||||||
|
for(var j = 0; j < item.parts.length; j++) {
|
||||||
|
parts.push(addStyle(item.parts[j], options));
|
||||||
|
}
|
||||||
|
stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function listToStyles(list) {
|
||||||
|
var styles = [];
|
||||||
|
var newStyles = {};
|
||||||
|
for(var i = 0; i < list.length; i++) {
|
||||||
|
var item = list[i];
|
||||||
|
var id = item[0];
|
||||||
|
var css = item[1];
|
||||||
|
var media = item[2];
|
||||||
|
var sourceMap = item[3];
|
||||||
|
var part = {css: css, media: media, sourceMap: sourceMap};
|
||||||
|
if(!newStyles[id])
|
||||||
|
styles.push(newStyles[id] = {id: id, parts: [part]});
|
||||||
|
else
|
||||||
|
newStyles[id].parts.push(part);
|
||||||
|
}
|
||||||
|
return styles;
|
||||||
|
}
|
||||||
|
|
||||||
|
function insertStyleElement(options, styleElement) {
|
||||||
|
var head = getHeadElement();
|
||||||
|
var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
|
||||||
|
if (options.insertAt === "top") {
|
||||||
|
if(!lastStyleElementInsertedAtTop) {
|
||||||
|
head.insertBefore(styleElement, head.firstChild);
|
||||||
|
} else if(lastStyleElementInsertedAtTop.nextSibling) {
|
||||||
|
head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
|
||||||
|
} else {
|
||||||
|
head.appendChild(styleElement);
|
||||||
|
}
|
||||||
|
styleElementsInsertedAtTop.push(styleElement);
|
||||||
|
} else if (options.insertAt === "bottom") {
|
||||||
|
head.appendChild(styleElement);
|
||||||
|
} else {
|
||||||
|
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeStyleElement(styleElement) {
|
||||||
|
styleElement.parentNode.removeChild(styleElement);
|
||||||
|
var idx = styleElementsInsertedAtTop.indexOf(styleElement);
|
||||||
|
if(idx >= 0) {
|
||||||
|
styleElementsInsertedAtTop.splice(idx, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createStyleElement(options) {
|
||||||
|
var styleElement = document.createElement("style");
|
||||||
|
styleElement.type = "text/css";
|
||||||
|
insertStyleElement(options, styleElement);
|
||||||
|
return styleElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createLinkElement(options) {
|
||||||
|
var linkElement = document.createElement("link");
|
||||||
|
linkElement.rel = "stylesheet";
|
||||||
|
insertStyleElement(options, linkElement);
|
||||||
|
return linkElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
function addStyle(obj, options) {
|
||||||
|
var styleElement, update, remove;
|
||||||
|
|
||||||
|
if (options.singleton) {
|
||||||
|
var styleIndex = singletonCounter++;
|
||||||
|
styleElement = singletonElement || (singletonElement = createStyleElement(options));
|
||||||
|
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
|
||||||
|
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
|
||||||
|
} else if(obj.sourceMap &&
|
||||||
|
typeof URL === "function" &&
|
||||||
|
typeof URL.createObjectURL === "function" &&
|
||||||
|
typeof URL.revokeObjectURL === "function" &&
|
||||||
|
typeof Blob === "function" &&
|
||||||
|
typeof btoa === "function") {
|
||||||
|
styleElement = createLinkElement(options);
|
||||||
|
update = updateLink.bind(null, styleElement);
|
||||||
|
remove = function() {
|
||||||
|
removeStyleElement(styleElement);
|
||||||
|
if(styleElement.href)
|
||||||
|
URL.revokeObjectURL(styleElement.href);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
styleElement = createStyleElement(options);
|
||||||
|
update = applyToTag.bind(null, styleElement);
|
||||||
|
remove = function() {
|
||||||
|
removeStyleElement(styleElement);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
update(obj);
|
||||||
|
|
||||||
|
return function updateStyle(newObj) {
|
||||||
|
if(newObj) {
|
||||||
|
if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
|
||||||
|
return;
|
||||||
|
update(obj = newObj);
|
||||||
|
} else {
|
||||||
|
remove();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var replaceText = (function () {
|
||||||
|
var textStore = [];
|
||||||
|
|
||||||
|
return function (index, replacement) {
|
||||||
|
textStore[index] = replacement;
|
||||||
|
return textStore.filter(Boolean).join('\n');
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
|
function applyToSingletonTag(styleElement, index, remove, obj) {
|
||||||
|
var css = remove ? "" : obj.css;
|
||||||
|
|
||||||
|
if (styleElement.styleSheet) {
|
||||||
|
styleElement.styleSheet.cssText = replaceText(index, css);
|
||||||
|
} else {
|
||||||
|
var cssNode = document.createTextNode(css);
|
||||||
|
var childNodes = styleElement.childNodes;
|
||||||
|
if (childNodes[index]) styleElement.removeChild(childNodes[index]);
|
||||||
|
if (childNodes.length) {
|
||||||
|
styleElement.insertBefore(cssNode, childNodes[index]);
|
||||||
|
} else {
|
||||||
|
styleElement.appendChild(cssNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function applyToTag(styleElement, obj) {
|
||||||
|
var css = obj.css;
|
||||||
|
var media = obj.media;
|
||||||
|
|
||||||
|
if(media) {
|
||||||
|
styleElement.setAttribute("media", media)
|
||||||
|
}
|
||||||
|
|
||||||
|
if(styleElement.styleSheet) {
|
||||||
|
styleElement.styleSheet.cssText = css;
|
||||||
|
} else {
|
||||||
|
while(styleElement.firstChild) {
|
||||||
|
styleElement.removeChild(styleElement.firstChild);
|
||||||
|
}
|
||||||
|
styleElement.appendChild(document.createTextNode(css));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateLink(linkElement, obj) {
|
||||||
|
var css = obj.css;
|
||||||
|
var sourceMap = obj.sourceMap;
|
||||||
|
|
||||||
|
if(sourceMap) {
|
||||||
|
// http://stackoverflow.com/a/26603875
|
||||||
|
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
|
||||||
|
}
|
||||||
|
|
||||||
|
var blob = new Blob([css], { type: "text/css" });
|
||||||
|
|
||||||
|
var oldSrc = linkElement.href;
|
||||||
|
|
||||||
|
linkElement.href = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
if(oldSrc)
|
||||||
|
URL.revokeObjectURL(oldSrc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Webpack App</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,428 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // identity function for calling harmony imports with the correct context
|
||||||
|
/******/ __webpack_require__.i = function(value) { return value; };
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
||||||
|
|
||||||
|
// load the styles
|
||||||
|
var content = __webpack_require__(2);
|
||||||
|
if(typeof content === 'string') content = [[module.i, content, '']];
|
||||||
|
// add the styles to the DOM
|
||||||
|
var update = __webpack_require__(4)(content, {});
|
||||||
|
if(content.locals) module.exports = content.locals;
|
||||||
|
// Hot Module Replacement
|
||||||
|
if(false) {
|
||||||
|
// When the styles change, update the <style> tags
|
||||||
|
if(!content.locals) {
|
||||||
|
module.hot.accept("!!../../node_modules/css-loader/index.js!./main.css", function() {
|
||||||
|
var newContent = require("!!../../node_modules/css-loader/index.js!./main.css");
|
||||||
|
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
||||||
|
update(newContent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// When the module is disposed, remove the <style> tags
|
||||||
|
module.hot.dispose(function() { update(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(0);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 2 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
exports = module.exports = __webpack_require__(3)();
|
||||||
|
// imports
|
||||||
|
|
||||||
|
|
||||||
|
// module
|
||||||
|
exports.push([module.i, "body {\n background: snow;\n}", ""]);
|
||||||
|
|
||||||
|
// exports
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 3 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||||
|
Author Tobias Koppers @sokra
|
||||||
|
*/
|
||||||
|
// css base code, injected by the css-loader
|
||||||
|
module.exports = function() {
|
||||||
|
var list = [];
|
||||||
|
|
||||||
|
// return the list of modules as css string
|
||||||
|
list.toString = function toString() {
|
||||||
|
var result = [];
|
||||||
|
for(var i = 0; i < this.length; i++) {
|
||||||
|
var item = this[i];
|
||||||
|
if(item[2]) {
|
||||||
|
result.push("@media " + item[2] + "{" + item[1] + "}");
|
||||||
|
} else {
|
||||||
|
result.push(item[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.join("");
|
||||||
|
};
|
||||||
|
|
||||||
|
// import a list of modules into the list
|
||||||
|
list.i = function(modules, mediaQuery) {
|
||||||
|
if(typeof modules === "string")
|
||||||
|
modules = [[null, modules, ""]];
|
||||||
|
var alreadyImportedModules = {};
|
||||||
|
for(var i = 0; i < this.length; i++) {
|
||||||
|
var id = this[i][0];
|
||||||
|
if(typeof id === "number")
|
||||||
|
alreadyImportedModules[id] = true;
|
||||||
|
}
|
||||||
|
for(i = 0; i < modules.length; i++) {
|
||||||
|
var item = modules[i];
|
||||||
|
// skip already imported module
|
||||||
|
// this implementation is not 100% perfect for weird media query combinations
|
||||||
|
// when a module is imported multiple times with different media queries.
|
||||||
|
// I hope this will never occur (Hey this way we have smaller bundles)
|
||||||
|
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
|
||||||
|
if(mediaQuery && !item[2]) {
|
||||||
|
item[2] = mediaQuery;
|
||||||
|
} else if(mediaQuery) {
|
||||||
|
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
|
||||||
|
}
|
||||||
|
list.push(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return list;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 4 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||||
|
Author Tobias Koppers @sokra
|
||||||
|
*/
|
||||||
|
var stylesInDom = {},
|
||||||
|
memoize = function(fn) {
|
||||||
|
var memo;
|
||||||
|
return function () {
|
||||||
|
if (typeof memo === "undefined") memo = fn.apply(this, arguments);
|
||||||
|
return memo;
|
||||||
|
};
|
||||||
|
},
|
||||||
|
isOldIE = memoize(function() {
|
||||||
|
return /msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase());
|
||||||
|
}),
|
||||||
|
getHeadElement = memoize(function () {
|
||||||
|
return document.head || document.getElementsByTagName("head")[0];
|
||||||
|
}),
|
||||||
|
singletonElement = null,
|
||||||
|
singletonCounter = 0,
|
||||||
|
styleElementsInsertedAtTop = [];
|
||||||
|
|
||||||
|
module.exports = function(list, options) {
|
||||||
|
if(typeof DEBUG !== "undefined" && DEBUG) {
|
||||||
|
if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
|
||||||
|
}
|
||||||
|
|
||||||
|
options = options || {};
|
||||||
|
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
|
||||||
|
// tags it will allow on a page
|
||||||
|
if (typeof options.singleton === "undefined") options.singleton = isOldIE();
|
||||||
|
|
||||||
|
// By default, add <style> tags to the bottom of <head>.
|
||||||
|
if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
|
||||||
|
|
||||||
|
var styles = listToStyles(list);
|
||||||
|
addStylesToDom(styles, options);
|
||||||
|
|
||||||
|
return function update(newList) {
|
||||||
|
var mayRemove = [];
|
||||||
|
for(var i = 0; i < styles.length; i++) {
|
||||||
|
var item = styles[i];
|
||||||
|
var domStyle = stylesInDom[item.id];
|
||||||
|
domStyle.refs--;
|
||||||
|
mayRemove.push(domStyle);
|
||||||
|
}
|
||||||
|
if(newList) {
|
||||||
|
var newStyles = listToStyles(newList);
|
||||||
|
addStylesToDom(newStyles, options);
|
||||||
|
}
|
||||||
|
for(var i = 0; i < mayRemove.length; i++) {
|
||||||
|
var domStyle = mayRemove[i];
|
||||||
|
if(domStyle.refs === 0) {
|
||||||
|
for(var j = 0; j < domStyle.parts.length; j++)
|
||||||
|
domStyle.parts[j]();
|
||||||
|
delete stylesInDom[domStyle.id];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function addStylesToDom(styles, options) {
|
||||||
|
for(var i = 0; i < styles.length; i++) {
|
||||||
|
var item = styles[i];
|
||||||
|
var domStyle = stylesInDom[item.id];
|
||||||
|
if(domStyle) {
|
||||||
|
domStyle.refs++;
|
||||||
|
for(var j = 0; j < domStyle.parts.length; j++) {
|
||||||
|
domStyle.parts[j](item.parts[j]);
|
||||||
|
}
|
||||||
|
for(; j < item.parts.length; j++) {
|
||||||
|
domStyle.parts.push(addStyle(item.parts[j], options));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var parts = [];
|
||||||
|
for(var j = 0; j < item.parts.length; j++) {
|
||||||
|
parts.push(addStyle(item.parts[j], options));
|
||||||
|
}
|
||||||
|
stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function listToStyles(list) {
|
||||||
|
var styles = [];
|
||||||
|
var newStyles = {};
|
||||||
|
for(var i = 0; i < list.length; i++) {
|
||||||
|
var item = list[i];
|
||||||
|
var id = item[0];
|
||||||
|
var css = item[1];
|
||||||
|
var media = item[2];
|
||||||
|
var sourceMap = item[3];
|
||||||
|
var part = {css: css, media: media, sourceMap: sourceMap};
|
||||||
|
if(!newStyles[id])
|
||||||
|
styles.push(newStyles[id] = {id: id, parts: [part]});
|
||||||
|
else
|
||||||
|
newStyles[id].parts.push(part);
|
||||||
|
}
|
||||||
|
return styles;
|
||||||
|
}
|
||||||
|
|
||||||
|
function insertStyleElement(options, styleElement) {
|
||||||
|
var head = getHeadElement();
|
||||||
|
var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
|
||||||
|
if (options.insertAt === "top") {
|
||||||
|
if(!lastStyleElementInsertedAtTop) {
|
||||||
|
head.insertBefore(styleElement, head.firstChild);
|
||||||
|
} else if(lastStyleElementInsertedAtTop.nextSibling) {
|
||||||
|
head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
|
||||||
|
} else {
|
||||||
|
head.appendChild(styleElement);
|
||||||
|
}
|
||||||
|
styleElementsInsertedAtTop.push(styleElement);
|
||||||
|
} else if (options.insertAt === "bottom") {
|
||||||
|
head.appendChild(styleElement);
|
||||||
|
} else {
|
||||||
|
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeStyleElement(styleElement) {
|
||||||
|
styleElement.parentNode.removeChild(styleElement);
|
||||||
|
var idx = styleElementsInsertedAtTop.indexOf(styleElement);
|
||||||
|
if(idx >= 0) {
|
||||||
|
styleElementsInsertedAtTop.splice(idx, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createStyleElement(options) {
|
||||||
|
var styleElement = document.createElement("style");
|
||||||
|
styleElement.type = "text/css";
|
||||||
|
insertStyleElement(options, styleElement);
|
||||||
|
return styleElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createLinkElement(options) {
|
||||||
|
var linkElement = document.createElement("link");
|
||||||
|
linkElement.rel = "stylesheet";
|
||||||
|
insertStyleElement(options, linkElement);
|
||||||
|
return linkElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
function addStyle(obj, options) {
|
||||||
|
var styleElement, update, remove;
|
||||||
|
|
||||||
|
if (options.singleton) {
|
||||||
|
var styleIndex = singletonCounter++;
|
||||||
|
styleElement = singletonElement || (singletonElement = createStyleElement(options));
|
||||||
|
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
|
||||||
|
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
|
||||||
|
} else if(obj.sourceMap &&
|
||||||
|
typeof URL === "function" &&
|
||||||
|
typeof URL.createObjectURL === "function" &&
|
||||||
|
typeof URL.revokeObjectURL === "function" &&
|
||||||
|
typeof Blob === "function" &&
|
||||||
|
typeof btoa === "function") {
|
||||||
|
styleElement = createLinkElement(options);
|
||||||
|
update = updateLink.bind(null, styleElement);
|
||||||
|
remove = function() {
|
||||||
|
removeStyleElement(styleElement);
|
||||||
|
if(styleElement.href)
|
||||||
|
URL.revokeObjectURL(styleElement.href);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
styleElement = createStyleElement(options);
|
||||||
|
update = applyToTag.bind(null, styleElement);
|
||||||
|
remove = function() {
|
||||||
|
removeStyleElement(styleElement);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
update(obj);
|
||||||
|
|
||||||
|
return function updateStyle(newObj) {
|
||||||
|
if(newObj) {
|
||||||
|
if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
|
||||||
|
return;
|
||||||
|
update(obj = newObj);
|
||||||
|
} else {
|
||||||
|
remove();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var replaceText = (function () {
|
||||||
|
var textStore = [];
|
||||||
|
|
||||||
|
return function (index, replacement) {
|
||||||
|
textStore[index] = replacement;
|
||||||
|
return textStore.filter(Boolean).join('\n');
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
|
function applyToSingletonTag(styleElement, index, remove, obj) {
|
||||||
|
var css = remove ? "" : obj.css;
|
||||||
|
|
||||||
|
if (styleElement.styleSheet) {
|
||||||
|
styleElement.styleSheet.cssText = replaceText(index, css);
|
||||||
|
} else {
|
||||||
|
var cssNode = document.createTextNode(css);
|
||||||
|
var childNodes = styleElement.childNodes;
|
||||||
|
if (childNodes[index]) styleElement.removeChild(childNodes[index]);
|
||||||
|
if (childNodes.length) {
|
||||||
|
styleElement.insertBefore(cssNode, childNodes[index]);
|
||||||
|
} else {
|
||||||
|
styleElement.appendChild(cssNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function applyToTag(styleElement, obj) {
|
||||||
|
var css = obj.css;
|
||||||
|
var media = obj.media;
|
||||||
|
|
||||||
|
if(media) {
|
||||||
|
styleElement.setAttribute("media", media)
|
||||||
|
}
|
||||||
|
|
||||||
|
if(styleElement.styleSheet) {
|
||||||
|
styleElement.styleSheet.cssText = css;
|
||||||
|
} else {
|
||||||
|
while(styleElement.firstChild) {
|
||||||
|
styleElement.removeChild(styleElement.firstChild);
|
||||||
|
}
|
||||||
|
styleElement.appendChild(document.createTextNode(css));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateLink(linkElement, obj) {
|
||||||
|
var css = obj.css;
|
||||||
|
var sourceMap = obj.sourceMap;
|
||||||
|
|
||||||
|
if(sourceMap) {
|
||||||
|
// http://stackoverflow.com/a/26603875
|
||||||
|
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
|
||||||
|
}
|
||||||
|
|
||||||
|
var blob = new Blob([css], { type: "text/css" });
|
||||||
|
|
||||||
|
var oldSrc = linkElement.href;
|
||||||
|
|
||||||
|
linkElement.href = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
if(oldSrc)
|
||||||
|
URL.revokeObjectURL(oldSrc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Webpack App</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,425 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(1);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
||||||
|
|
||||||
|
// load the styles
|
||||||
|
var content = __webpack_require__(2);
|
||||||
|
if(typeof content === 'string') content = [[module.i, content, '']];
|
||||||
|
// add the styles to the DOM
|
||||||
|
var update = __webpack_require__(4)(content, {});
|
||||||
|
if(content.locals) module.exports = content.locals;
|
||||||
|
// Hot Module Replacement
|
||||||
|
if(false) {
|
||||||
|
// When the styles change, update the <style> tags
|
||||||
|
if(!content.locals) {
|
||||||
|
module.hot.accept("!!../../node_modules/css-loader/index.js!./main.css", function() {
|
||||||
|
var newContent = require("!!../../node_modules/css-loader/index.js!./main.css");
|
||||||
|
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
||||||
|
update(newContent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// When the module is disposed, remove the <style> tags
|
||||||
|
module.hot.dispose(function() { update(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 2 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
exports = module.exports = __webpack_require__(3)();
|
||||||
|
// imports
|
||||||
|
|
||||||
|
|
||||||
|
// module
|
||||||
|
exports.push([module.i, "body {\n background: snow;\n}", ""]);
|
||||||
|
|
||||||
|
// exports
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 3 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||||
|
Author Tobias Koppers @sokra
|
||||||
|
*/
|
||||||
|
// css base code, injected by the css-loader
|
||||||
|
module.exports = function() {
|
||||||
|
var list = [];
|
||||||
|
|
||||||
|
// return the list of modules as css string
|
||||||
|
list.toString = function toString() {
|
||||||
|
var result = [];
|
||||||
|
for(var i = 0; i < this.length; i++) {
|
||||||
|
var item = this[i];
|
||||||
|
if(item[2]) {
|
||||||
|
result.push("@media " + item[2] + "{" + item[1] + "}");
|
||||||
|
} else {
|
||||||
|
result.push(item[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.join("");
|
||||||
|
};
|
||||||
|
|
||||||
|
// import a list of modules into the list
|
||||||
|
list.i = function(modules, mediaQuery) {
|
||||||
|
if(typeof modules === "string")
|
||||||
|
modules = [[null, modules, ""]];
|
||||||
|
var alreadyImportedModules = {};
|
||||||
|
for(var i = 0; i < this.length; i++) {
|
||||||
|
var id = this[i][0];
|
||||||
|
if(typeof id === "number")
|
||||||
|
alreadyImportedModules[id] = true;
|
||||||
|
}
|
||||||
|
for(i = 0; i < modules.length; i++) {
|
||||||
|
var item = modules[i];
|
||||||
|
// skip already imported module
|
||||||
|
// this implementation is not 100% perfect for weird media query combinations
|
||||||
|
// when a module is imported multiple times with different media queries.
|
||||||
|
// I hope this will never occur (Hey this way we have smaller bundles)
|
||||||
|
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
|
||||||
|
if(mediaQuery && !item[2]) {
|
||||||
|
item[2] = mediaQuery;
|
||||||
|
} else if(mediaQuery) {
|
||||||
|
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
|
||||||
|
}
|
||||||
|
list.push(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return list;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 4 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||||
|
Author Tobias Koppers @sokra
|
||||||
|
*/
|
||||||
|
var stylesInDom = {},
|
||||||
|
memoize = function(fn) {
|
||||||
|
var memo;
|
||||||
|
return function () {
|
||||||
|
if (typeof memo === "undefined") memo = fn.apply(this, arguments);
|
||||||
|
return memo;
|
||||||
|
};
|
||||||
|
},
|
||||||
|
isOldIE = memoize(function() {
|
||||||
|
return /msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase());
|
||||||
|
}),
|
||||||
|
getHeadElement = memoize(function () {
|
||||||
|
return document.head || document.getElementsByTagName("head")[0];
|
||||||
|
}),
|
||||||
|
singletonElement = null,
|
||||||
|
singletonCounter = 0,
|
||||||
|
styleElementsInsertedAtTop = [];
|
||||||
|
|
||||||
|
module.exports = function(list, options) {
|
||||||
|
if(typeof DEBUG !== "undefined" && DEBUG) {
|
||||||
|
if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
|
||||||
|
}
|
||||||
|
|
||||||
|
options = options || {};
|
||||||
|
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
|
||||||
|
// tags it will allow on a page
|
||||||
|
if (typeof options.singleton === "undefined") options.singleton = isOldIE();
|
||||||
|
|
||||||
|
// By default, add <style> tags to the bottom of <head>.
|
||||||
|
if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
|
||||||
|
|
||||||
|
var styles = listToStyles(list);
|
||||||
|
addStylesToDom(styles, options);
|
||||||
|
|
||||||
|
return function update(newList) {
|
||||||
|
var mayRemove = [];
|
||||||
|
for(var i = 0; i < styles.length; i++) {
|
||||||
|
var item = styles[i];
|
||||||
|
var domStyle = stylesInDom[item.id];
|
||||||
|
domStyle.refs--;
|
||||||
|
mayRemove.push(domStyle);
|
||||||
|
}
|
||||||
|
if(newList) {
|
||||||
|
var newStyles = listToStyles(newList);
|
||||||
|
addStylesToDom(newStyles, options);
|
||||||
|
}
|
||||||
|
for(var i = 0; i < mayRemove.length; i++) {
|
||||||
|
var domStyle = mayRemove[i];
|
||||||
|
if(domStyle.refs === 0) {
|
||||||
|
for(var j = 0; j < domStyle.parts.length; j++)
|
||||||
|
domStyle.parts[j]();
|
||||||
|
delete stylesInDom[domStyle.id];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function addStylesToDom(styles, options) {
|
||||||
|
for(var i = 0; i < styles.length; i++) {
|
||||||
|
var item = styles[i];
|
||||||
|
var domStyle = stylesInDom[item.id];
|
||||||
|
if(domStyle) {
|
||||||
|
domStyle.refs++;
|
||||||
|
for(var j = 0; j < domStyle.parts.length; j++) {
|
||||||
|
domStyle.parts[j](item.parts[j]);
|
||||||
|
}
|
||||||
|
for(; j < item.parts.length; j++) {
|
||||||
|
domStyle.parts.push(addStyle(item.parts[j], options));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var parts = [];
|
||||||
|
for(var j = 0; j < item.parts.length; j++) {
|
||||||
|
parts.push(addStyle(item.parts[j], options));
|
||||||
|
}
|
||||||
|
stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function listToStyles(list) {
|
||||||
|
var styles = [];
|
||||||
|
var newStyles = {};
|
||||||
|
for(var i = 0; i < list.length; i++) {
|
||||||
|
var item = list[i];
|
||||||
|
var id = item[0];
|
||||||
|
var css = item[1];
|
||||||
|
var media = item[2];
|
||||||
|
var sourceMap = item[3];
|
||||||
|
var part = {css: css, media: media, sourceMap: sourceMap};
|
||||||
|
if(!newStyles[id])
|
||||||
|
styles.push(newStyles[id] = {id: id, parts: [part]});
|
||||||
|
else
|
||||||
|
newStyles[id].parts.push(part);
|
||||||
|
}
|
||||||
|
return styles;
|
||||||
|
}
|
||||||
|
|
||||||
|
function insertStyleElement(options, styleElement) {
|
||||||
|
var head = getHeadElement();
|
||||||
|
var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
|
||||||
|
if (options.insertAt === "top") {
|
||||||
|
if(!lastStyleElementInsertedAtTop) {
|
||||||
|
head.insertBefore(styleElement, head.firstChild);
|
||||||
|
} else if(lastStyleElementInsertedAtTop.nextSibling) {
|
||||||
|
head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
|
||||||
|
} else {
|
||||||
|
head.appendChild(styleElement);
|
||||||
|
}
|
||||||
|
styleElementsInsertedAtTop.push(styleElement);
|
||||||
|
} else if (options.insertAt === "bottom") {
|
||||||
|
head.appendChild(styleElement);
|
||||||
|
} else {
|
||||||
|
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeStyleElement(styleElement) {
|
||||||
|
styleElement.parentNode.removeChild(styleElement);
|
||||||
|
var idx = styleElementsInsertedAtTop.indexOf(styleElement);
|
||||||
|
if(idx >= 0) {
|
||||||
|
styleElementsInsertedAtTop.splice(idx, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createStyleElement(options) {
|
||||||
|
var styleElement = document.createElement("style");
|
||||||
|
styleElement.type = "text/css";
|
||||||
|
insertStyleElement(options, styleElement);
|
||||||
|
return styleElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createLinkElement(options) {
|
||||||
|
var linkElement = document.createElement("link");
|
||||||
|
linkElement.rel = "stylesheet";
|
||||||
|
insertStyleElement(options, linkElement);
|
||||||
|
return linkElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
function addStyle(obj, options) {
|
||||||
|
var styleElement, update, remove;
|
||||||
|
|
||||||
|
if (options.singleton) {
|
||||||
|
var styleIndex = singletonCounter++;
|
||||||
|
styleElement = singletonElement || (singletonElement = createStyleElement(options));
|
||||||
|
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
|
||||||
|
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
|
||||||
|
} else if(obj.sourceMap &&
|
||||||
|
typeof URL === "function" &&
|
||||||
|
typeof URL.createObjectURL === "function" &&
|
||||||
|
typeof URL.revokeObjectURL === "function" &&
|
||||||
|
typeof Blob === "function" &&
|
||||||
|
typeof btoa === "function") {
|
||||||
|
styleElement = createLinkElement(options);
|
||||||
|
update = updateLink.bind(null, styleElement);
|
||||||
|
remove = function() {
|
||||||
|
removeStyleElement(styleElement);
|
||||||
|
if(styleElement.href)
|
||||||
|
URL.revokeObjectURL(styleElement.href);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
styleElement = createStyleElement(options);
|
||||||
|
update = applyToTag.bind(null, styleElement);
|
||||||
|
remove = function() {
|
||||||
|
removeStyleElement(styleElement);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
update(obj);
|
||||||
|
|
||||||
|
return function updateStyle(newObj) {
|
||||||
|
if(newObj) {
|
||||||
|
if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
|
||||||
|
return;
|
||||||
|
update(obj = newObj);
|
||||||
|
} else {
|
||||||
|
remove();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var replaceText = (function () {
|
||||||
|
var textStore = [];
|
||||||
|
|
||||||
|
return function (index, replacement) {
|
||||||
|
textStore[index] = replacement;
|
||||||
|
return textStore.filter(Boolean).join('\n');
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
|
function applyToSingletonTag(styleElement, index, remove, obj) {
|
||||||
|
var css = remove ? "" : obj.css;
|
||||||
|
|
||||||
|
if (styleElement.styleSheet) {
|
||||||
|
styleElement.styleSheet.cssText = replaceText(index, css);
|
||||||
|
} else {
|
||||||
|
var cssNode = document.createTextNode(css);
|
||||||
|
var childNodes = styleElement.childNodes;
|
||||||
|
if (childNodes[index]) styleElement.removeChild(childNodes[index]);
|
||||||
|
if (childNodes.length) {
|
||||||
|
styleElement.insertBefore(cssNode, childNodes[index]);
|
||||||
|
} else {
|
||||||
|
styleElement.appendChild(cssNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function applyToTag(styleElement, obj) {
|
||||||
|
var css = obj.css;
|
||||||
|
var media = obj.media;
|
||||||
|
|
||||||
|
if(media) {
|
||||||
|
styleElement.setAttribute("media", media)
|
||||||
|
}
|
||||||
|
|
||||||
|
if(styleElement.styleSheet) {
|
||||||
|
styleElement.styleSheet.cssText = css;
|
||||||
|
} else {
|
||||||
|
while(styleElement.firstChild) {
|
||||||
|
styleElement.removeChild(styleElement.firstChild);
|
||||||
|
}
|
||||||
|
styleElement.appendChild(document.createTextNode(css));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateLink(linkElement, obj) {
|
||||||
|
var css = obj.css;
|
||||||
|
var sourceMap = obj.sourceMap;
|
||||||
|
|
||||||
|
if(sourceMap) {
|
||||||
|
// http://stackoverflow.com/a/26603875
|
||||||
|
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
|
||||||
|
}
|
||||||
|
|
||||||
|
var blob = new Blob([css], { type: "text/css" });
|
||||||
|
|
||||||
|
var oldSrc = linkElement.href;
|
||||||
|
|
||||||
|
linkElement.href = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
if(oldSrc)
|
||||||
|
URL.revokeObjectURL(oldSrc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Webpack App</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
require('./main.css');
|
require('./main.css');
|
||||||
var h1 = document.createElement('h1');
|
var h1 = document.createElement('h1');
|
||||||
h1.innerHTML = 'Hello world!';
|
h1.innerHTML = 'Hello world!';
|
||||||
document.body.appendChild(h1);
|
document.body.appendChild(h1);
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
var HtmlWebpackPlugin = require('..');
|
var path = require('path');
|
||||||
|
var HtmlWebpackPlugin = require('../..');
|
||||||
|
var webpackMajorVersion = require('webpack/package.json').version.split('.')[0];
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
context: __dirname,
|
||||||
entry: './example.js',
|
entry: './example.js',
|
||||||
output: {
|
output: {
|
||||||
path: __dirname + '/dist',
|
path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion),
|
||||||
publicPath: '',
|
publicPath: '',
|
||||||
filename: 'bundle.js'
|
filename: 'bundle.js'
|
||||||
},
|
},
|
||||||
|
|
@ -15,4 +18,4 @@ module.exports = {
|
||||||
plugins: [
|
plugins: [
|
||||||
new HtmlWebpackPlugin()
|
new HtmlWebpackPlugin()
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId])
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ exports: {},
|
||||||
|
/******/ id: moduleId,
|
||||||
|
/******/ loaded: false
|
||||||
|
/******/ };
|
||||||
|
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.loaded = true;
|
||||||
|
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
|
||||||
|
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(1);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>HtmlWebpackPlugin example</title>
|
||||||
|
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
After Width: | Height: | Size: 766 B |
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // identity function for calling harmony imports with the correct context
|
||||||
|
/******/ __webpack_require__.i = function(value) { return value; };
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(0);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>HtmlWebpackPlugin example</title>
|
||||||
|
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
After Width: | Height: | Size: 766 B |
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(1);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>HtmlWebpackPlugin example</title>
|
||||||
|
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
After Width: | Height: | Size: 766 B |
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
require('./main.css');
|
require('./main.css');
|
||||||
var h1 = document.createElement('h1');
|
var h1 = document.createElement('h1');
|
||||||
h1.innerHTML = 'Hello world!';
|
h1.innerHTML = 'Hello world!';
|
||||||
document.body.appendChild(h1);
|
document.body.appendChild(h1);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
var HtmlWebpackPlugin = require('..');
|
var path = require('path');
|
||||||
|
var HtmlWebpackPlugin = require('../..');
|
||||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
|
var webpackMajorVersion = require('webpack/package.json').version.split('.')[0];
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
context: __dirname,
|
||||||
entry: './example.js',
|
entry: './example.js',
|
||||||
output: {
|
output: {
|
||||||
path: __dirname + '/dist',
|
path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion),
|
||||||
publicPath: '',
|
publicPath: '',
|
||||||
filename: 'bundle.js'
|
filename: 'bundle.js'
|
||||||
},
|
},
|
||||||
|
|
@ -21,4 +24,4 @@ module.exports = {
|
||||||
}),
|
}),
|
||||||
new ExtractTextPlugin('styles.css')
|
new ExtractTextPlugin('styles.css')
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Example template</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<img src="0714810ae3fb211173e2964249507195.png">
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId])
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ exports: {},
|
||||||
|
/******/ id: moduleId,
|
||||||
|
/******/ loaded: false
|
||||||
|
/******/ };
|
||||||
|
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.loaded = true;
|
||||||
|
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
|
||||||
|
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(1);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
After Width: | Height: | Size: 766 B |
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Example template</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<img src="0714810ae3fb211173e2964249507195.png">
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Example template</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<img src="0714810ae3fb211173e2964249507195.png">
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // identity function for calling harmony imports with the correct context
|
||||||
|
/******/ __webpack_require__.i = function(value) { return value; };
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(0);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
After Width: | Height: | Size: 766 B |
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Example template</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<img src="0714810ae3fb211173e2964249507195.png">
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 53 KiB |
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Example template</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<img src="0714810ae3fb211173e2964249507195.png">
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
__webpack_require__(1);
|
||||||
|
var h1 = document.createElement('h1');
|
||||||
|
h1.innerHTML = 'Hello world!';
|
||||||
|
document.body.appendChild(h1);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
After Width: | Height: | Size: 766 B |
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Example template</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="shortcut icon" href="favicon.ico"><link href="styles.css" rel="stylesheet"></head>
|
||||||
|
<body>
|
||||||
|
<img src="0714810ae3fb211173e2964249507195.png">
|
||||||
|
<script type="text/javascript" src="bundle.js"></script></body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
require('./main.css');
|
require('./main.css');
|
||||||
var h1 = document.createElement('h1');
|
var h1 = document.createElement('h1');
|
||||||
h1.innerHTML = 'Hello world!';
|
h1.innerHTML = 'Hello world!';
|
||||||
document.body.appendChild(h1);
|
document.body.appendChild(h1);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
|
var path = require('path');
|
||||||
var HtmlWebpackPlugin = require('../..');
|
var HtmlWebpackPlugin = require('../..');
|
||||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
|
var webpackMajorVersion = require('webpack/package.json').version.split('.')[0];
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
context: __dirname,
|
||||||
entry: './example.js',
|
entry: './example.js',
|
||||||
output: {
|
output: {
|
||||||
path: __dirname + '/dist',
|
path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion),
|
||||||
publicPath: '',
|
publicPath: '',
|
||||||
filename: 'bundle.js'
|
filename: 'bundle.js'
|
||||||
},
|
},
|
||||||
|
|
@ -11,7 +14,7 @@ module.exports = {
|
||||||
loaders: [
|
loaders: [
|
||||||
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') },
|
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') },
|
||||||
{ test: /\.png$/, loader: 'file-loader' },
|
{ test: /\.png$/, loader: 'file-loader' },
|
||||||
{ test: /\.html$/, loader: 'html-loader' },
|
{ test: /\.html$/, loader: 'html-loader' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|
@ -27,4 +30,4 @@ module.exports = {
|
||||||
}),
|
}),
|
||||||
new ExtractTextPlugin('styles.css')
|
new ExtractTextPlugin('styles.css')
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId])
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ exports: {},
|
||||||
|
/******/ id: moduleId,
|
||||||
|
/******/ loaded: false
|
||||||
|
/******/ };
|
||||||
|
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.loaded = true;
|
||||||
|
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
|
||||||
|
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
__webpack_require__(1);
|
||||||
|
|
||||||
|
console.log('Hello World');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
After Width: | Height: | Size: 766 B |
|
|
@ -0,0 +1,62 @@
|
||||||
|
<!DOCTYPE html><html><head><meta http-equiv="Content-type" content="text/html; charset=utf-8"><title>Jade demo</title></head><body><style>body {
|
||||||
|
background: snow;
|
||||||
|
}</style><script type="text/javascript">/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId])
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ exports: {},
|
||||||
|
/******/ id: moduleId,
|
||||||
|
/******/ loaded: false
|
||||||
|
/******/ };
|
||||||
|
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.loaded = true;
|
||||||
|
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
|
||||||
|
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
__webpack_require__(1);
|
||||||
|
|
||||||
|
console.log('Hello World');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);</script></body></html>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // identity function for calling harmony imports with the correct context
|
||||||
|
/******/ __webpack_require__.i = function(value) { return value; };
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
__webpack_require__(0);
|
||||||
|
|
||||||
|
console.log('Hello World');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
After Width: | Height: | Size: 766 B |
|
|
@ -0,0 +1,89 @@
|
||||||
|
<!DOCTYPE html><html><head><meta http-equiv="Content-type" content="text/html; charset=utf-8"><title>Jade demo</title></head><body><style>body {
|
||||||
|
background: snow;
|
||||||
|
}</style><script type="text/javascript">/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // identity function for calling harmony imports with the correct context
|
||||||
|
/******/ __webpack_require__.i = function(value) { return value; };
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
__webpack_require__(0);
|
||||||
|
|
||||||
|
console.log('Hello World');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);</script></body></html>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background: snow;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
__webpack_require__(1);
|
||||||
|
|
||||||
|
console.log('Hello World');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);
|
||||||
|
After Width: | Height: | Size: 766 B |
|
|
@ -0,0 +1,86 @@
|
||||||
|
<!DOCTYPE html><html><head><meta http-equiv="Content-type" content="text/html; charset=utf-8"><title>Jade demo</title></head><body><style>body {
|
||||||
|
background: snow;
|
||||||
|
}</style><script type="text/javascript">/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {};
|
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) {
|
||||||
|
/******/
|
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) {
|
||||||
|
/******/ return installedModules[moduleId].exports;
|
||||||
|
/******/ }
|
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = {
|
||||||
|
/******/ i: moduleId,
|
||||||
|
/******/ l: false,
|
||||||
|
/******/ exports: {}
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
|
/******/
|
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true;
|
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports;
|
||||||
|
/******/ }
|
||||||
|
/******/
|
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules;
|
||||||
|
/******/
|
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules;
|
||||||
|
/******/
|
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||||
|
/******/ Object.defineProperty(exports, name, {
|
||||||
|
/******/ configurable: false,
|
||||||
|
/******/ enumerable: true,
|
||||||
|
/******/ get: getter
|
||||||
|
/******/ });
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) {
|
||||||
|
/******/ var getter = module && module.__esModule ?
|
||||||
|
/******/ function getDefault() { return module['default']; } :
|
||||||
|
/******/ function getModuleExports() { return module; };
|
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||||
|
/******/ return getter;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||||
|
/******/
|
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "";
|
||||||
|
/******/
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||||
|
/******/ })
|
||||||
|
/************************************************************************/
|
||||||
|
/******/ ([
|
||||||
|
/* 0 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
__webpack_require__(1);
|
||||||
|
|
||||||
|
console.log('Hello World');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 1 */
|
||||||
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
|
// removed by extract-text-webpack-plugin
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
/******/ ]);</script></body></html>
|
||||||