├── .editorconfig ├── .github └── issue_template.md ├── .gitignore ├── .mailmap ├── .node-version ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── appveyor.yml ├── default_index.ejs ├── docs └── template-option.md ├── examples ├── appcache │ ├── dist │ │ ├── webpack-1 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ ├── manifest.appcache │ │ │ └── styles.css │ │ ├── webpack-2 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ ├── manifest.appcache │ │ │ └── styles.css │ │ ├── webpack-3 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ ├── manifest.appcache │ │ │ └── styles.css │ │ └── webpack-4 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ ├── manifest.appcache │ │ │ └── styles.css │ ├── example.js │ ├── logo.png │ ├── main.css │ ├── template.html │ └── webpack.config.js ├── build-examples.js ├── custom-template │ ├── dist │ │ ├── webpack-1 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── webpack-2 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── webpack-3 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ └── styles.css │ │ └── webpack-4 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ └── styles.css │ ├── example.js │ ├── logo.png │ ├── main.css │ ├── partial.html │ ├── readme.md │ ├── template.html │ └── webpack.config.js ├── default │ ├── dist │ │ ├── webpack-1 │ │ │ ├── bundle.js │ │ │ └── index.html │ │ ├── webpack-2 │ │ │ ├── bundle.js │ │ │ └── index.html │ │ ├── webpack-3 │ │ │ ├── bundle.js │ │ │ └── index.html │ │ └── webpack-4 │ │ │ ├── bundle.js │ │ │ └── index.html │ ├── example.js │ ├── main.css │ ├── readme.md │ └── webpack.config.js ├── favicon │ ├── dist │ │ ├── webpack-1 │ │ │ ├── bundle.js │ │ │ ├── favicon.html │ │ │ ├── favicon.ico │ │ │ └── styles.css │ │ ├── webpack-2 │ │ │ ├── bundle.js │ │ │ ├── favicon.html │ │ │ ├── favicon.ico │ │ │ └── styles.css │ │ ├── webpack-3 │ │ │ ├── bundle.js │ │ │ ├── favicon.html │ │ │ ├── favicon.ico │ │ │ └── styles.css │ │ └── webpack-4 │ │ │ ├── bundle.js │ │ │ ├── favicon.html │ │ │ ├── favicon.ico │ │ │ └── styles.css │ ├── example.js │ ├── favicon.ico │ ├── main.css │ ├── template.html │ └── webpack.config.js ├── html-loader │ ├── dist │ │ ├── webpack-1 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── about.html │ │ │ ├── bundle.js │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── webpack-2 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── about.html │ │ │ ├── bundle.js │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── webpack-3 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── about.html │ │ │ ├── bundle.js │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── styles.css │ │ └── webpack-4 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── about.html │ │ │ ├── bundle.js │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── styles.css │ ├── example.js │ ├── favicon.ico │ ├── logo.png │ ├── main.css │ ├── template.html │ └── webpack.config.js ├── inline │ ├── dist │ │ ├── webpack-1 │ │ │ ├── bundle.js │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── webpack-2 │ │ │ ├── bundle.js │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── webpack-3 │ │ │ ├── bundle.js │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── styles.css │ │ └── webpack-4 │ │ │ ├── bundle.js │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── styles.css │ ├── example.js │ ├── favicon.ico │ ├── main.css │ ├── readme.md │ ├── template.jade │ └── webpack.config.js ├── jade-loader │ ├── dist │ │ ├── webpack-1 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── webpack-2 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── webpack-3 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── styles.css │ │ └── webpack-4 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── styles.css │ ├── example.js │ ├── favicon.ico │ ├── logo.png │ ├── main.css │ ├── readme.md │ ├── template.jade │ ├── time.jade │ └── webpack.config.js ├── javascript-advanced │ ├── dist │ │ ├── webpack-1 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── webpack-2 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── webpack-3 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ └── styles.css │ │ └── webpack-4 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ └── styles.css │ ├── example.js │ ├── logo.png │ ├── main.css │ ├── partial.html │ ├── readme.md │ ├── template.js │ ├── universial.js │ └── webpack.config.js ├── javascript │ ├── dist │ │ ├── webpack-1 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── webpack-2 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── webpack-3 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ └── styles.css │ │ └── webpack-4 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── bundle.js │ │ │ ├── index.html │ │ │ └── styles.css │ ├── example.js │ ├── logo.png │ ├── main.css │ ├── partial.html │ ├── readme.md │ ├── template.js │ ├── universial.js │ └── webpack.config.js ├── sort-manually │ ├── a.js │ ├── b.js │ ├── c.js │ ├── d.js │ ├── dist │ │ ├── webpack-1 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── a.js │ │ │ ├── b.js │ │ │ ├── c.js │ │ │ ├── d.js │ │ │ ├── e.js │ │ │ ├── first-file.html │ │ │ ├── second-file.html │ │ │ └── styles.css │ │ ├── webpack-2 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── a.js │ │ │ ├── b.js │ │ │ ├── c.js │ │ │ ├── d.js │ │ │ ├── e.js │ │ │ ├── first-file.html │ │ │ ├── second-file.html │ │ │ └── styles.css │ │ ├── webpack-3 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── a.js │ │ │ ├── b.js │ │ │ ├── c.js │ │ │ ├── d.js │ │ │ ├── e.js │ │ │ ├── first-file.html │ │ │ ├── second-file.html │ │ │ └── styles.css │ │ └── webpack-4 │ │ │ ├── 0714810ae3fb211173e2964249507195.png │ │ │ ├── a.js │ │ │ ├── b.js │ │ │ ├── c.js │ │ │ ├── d.js │ │ │ ├── e.js │ │ │ ├── first-file.html │ │ │ ├── second-file.html │ │ │ └── styles.css │ ├── e.js │ ├── logo.png │ ├── main.css │ ├── template.html │ └── webpack.config.js └── template-parameters │ ├── dist │ ├── webpack-1 │ │ ├── bundle.js │ │ └── index.html │ ├── webpack-2 │ │ ├── bundle.js │ │ └── index.html │ ├── webpack-3 │ │ ├── bundle.js │ │ └── index.html │ └── webpack-4 │ │ ├── bundle.js │ │ └── index.html │ ├── example.js │ ├── index.ejs │ ├── readme.md │ └── webpack.config.js ├── index.js ├── lib ├── chunksorter.js ├── compiler.js ├── errors.js └── loader.js ├── migration.md ├── package-lock.json ├── package.json └── spec ├── BasicSpec.js ├── CachingSpec.js ├── ExampleSpec.js ├── fixtures ├── async.js ├── common.js ├── empty_html.html ├── favicon.ico ├── index.js ├── invalid.html ├── legacy.html ├── main.css ├── plain.html ├── spaced_plain.html ├── template.jade ├── templateParam.js ├── test.html ├── theme.js ├── util.js └── webpackconfig.html └── support └── jasmine.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | insert_final_newline = true 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | trim_trailing_whitespace = true 9 | 10 | [*.md] 11 | trim_trailing_whitespace = false 12 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Prerequisites 4 | 5 | - 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. 6 | - Support questions are better asked in one of the following locations: 7 | - [Stack Overflow](http://stackoverflow.com/questions/tagged/html-webpack-plugin) 8 | - Ensure the issue isn't already reported. 9 | - Should be reproducible with the latest version of `html-webpack-plugin`. 10 | - (Ensure `npm ls html-webpack-plugin` matches ![](https://img.shields.io/npm/v/html-webpack-plugin.svg)) 11 | 12 | *Delete the above section and the instructions in the sections below before submitting* 13 | 14 | 15 | ## Description 16 | 17 | If this is a feature request, explain why it should be added. Specific use-cases are best. 18 | 19 | For bug reports, please provide as much *relevant* info as possible. 20 | 21 | ### Error Message & Stack Trace 22 | 23 | ``` 24 | COPY THE ERROR MESSAGE, INCLUDING STACK TRACE HERE 25 | ``` 26 | 27 | ### Config 28 | 29 | Copy the relevant section from `webpack.config.js`: 30 | 31 | ```js 32 | module.exports = { 33 | entry: 'app.js', 34 | output: { 35 | path: 'dist', 36 | filename: 'index_bundle.js' 37 | }, 38 | module: { 39 | rules: [ 40 | ... 41 | ] 42 | } 43 | plugins: [ 44 | new HtmlWebpackPlugin(), 45 | ... 46 | ] 47 | } 48 | ``` 49 | 50 | Copy your template file: 51 | 52 | ```html 53 | 54 | 55 | 56 | My App 57 | 58 | 59 | 60 | 61 | ``` 62 | 63 | 64 | ## Relevant Links 65 | 66 | - If your project is public, link to the repo so we can investigate directly. 67 | - **BONUS POINTS:** Create a [minimal reproduction](http://stackoverflow.com/help/mcve) and upload it to GitHub. This will get you the fastest support. 68 | 69 | 70 | ## Environment 71 | 72 | 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: 73 | 74 | ``` 75 | node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())" 76 | npm --version 77 | npm ls webpack 78 | npm ls html-webpack-plugin 79 | ``` 80 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /dist/ 3 | npm-debug.log 4 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Chris Greening 2 | Jan Nicklas 3 | Jan Nicklas 4 | Ma Cheng 5 | Michał Gołębiowski-Owczarek 6 | Thomas Grainger 7 | Thomas Grainger 8 | Zhanwei Wu 9 | -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 6.11.5 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - stable 4 | - lts/* 5 | - 6.9 6 | env: 7 | - WEBPACK_VERSION=1 EXTRACT_PLUGIN_VERSION=1 8 | - WEBPACK_VERSION=2 EXTRACT_PLUGIN_VERSION=2 9 | - WEBPACK_VERSION=3 EXTRACT_PLUGIN_VERSION=3.0.0-beta.3 10 | - WEBPACK_VERSION=4.0.0 EXTRACT_PLUGIN_VERSION=4.0.0-alpha.0 11 | before_install: 12 | - stty columns 120 13 | install: 14 | - npm install --ignore-scripts 15 | - npm rm webpack 16 | - npm rm extract-text-webpack-plugin 17 | - npm install webpack@$WEBPACK_VERSION extract-text-webpack-plugin@$EXTRACT_PLUGIN_VERSION --ignore-scripts || true 18 | script: 19 | - npm test 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | 'Software'), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # appveyor file 2 | # http://www.appveyor.com/docs/appveyor-yml 3 | 4 | environment: 5 | matrix: 6 | - nodejs_version: 0.10 7 | - nodejs_version: 0.12 8 | - nodejs_version: 4 9 | 10 | version: "{build}" 11 | build: off 12 | deploy: off 13 | matrix: 14 | fast_finish: true 15 | 16 | install: 17 | - ps: Install-Product node $env:nodejs_version 18 | - npm install 19 | 20 | test_script: 21 | - node --version 22 | - npm --version 23 | - npm test 24 | -------------------------------------------------------------------------------- /default_index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%= htmlWebpackPlugin.options.title %> 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/template-option.md: -------------------------------------------------------------------------------- 1 | # The template option 2 | 3 | ## History 4 | 5 | The version 2.x which was introduced last year (Sep, 2015) changed the way the template is processed. 6 | Instead of forcing all users to use the [blueimp](https://github.com/blueimp/JavaScript-Templates) template engine it allowed to use any webpack loader: 7 | 8 | * [jade/pug](https://github.com/pugjs/pug-loader) 9 | * [ejs](https://github.com/okonet/ejs-loader) 10 | * [underscore](https://github.com/emaphp/underscore-template-loader) 11 | * [handlebars](https://github.com/pcardune/handlebars-loader) 12 | * [html-loader](https://github.com/webpack/html-loader) 13 | * ... 14 | 15 | Under the hood it is using a webpack child compilation which inherits all loaders from 16 | your main configuration. 17 | 18 | There are three ways to set the loader: 19 | 20 | ## 1) Don't set any loader 21 | 22 | By default (if you don't specify any loader in any way) a [fallback lodash loader](https://github.com/ampedandwired/html-webpack-plugin/blob/master/lib/loader.js) kicks in. 23 | 24 | ```js 25 | { 26 | plugins: [ 27 | new HtmlWebpackPlugin({ 28 | template: 'src/index.html' 29 | }) 30 | ] 31 | } 32 | ``` 33 | Be aware, using `.html` as your template extention may unexpectedly trigger another loader. 34 | 35 | ## 2) Setting a loader directly for the template 36 | 37 | ```js 38 | new HtmlWebpackPlugin({ 39 | // For details on `!!` see https://webpack.github.io/docs/loaders.html#loader-order 40 | template: '!!handlebars!src/index.hbs' 41 | }) 42 | ``` 43 | 44 | ## 3) Setting a loader using the `module.loaders` syntax 45 | 46 | ```js 47 | { 48 | module: { 49 | loaders: [ 50 | { 51 | test: /\.hbs$/, 52 | loader: 'handlebars-loader' 53 | }, 54 | ] 55 | }, 56 | plugins: [ 57 | new HtmlWebpackPlugin({ 58 | template: 'src/index.hbs' 59 | }) 60 | ] 61 | } 62 | ``` 63 | 64 | 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/). 65 | This will **cause html minification** and it will also **disable the ejs fallback** loader. 66 | 67 | ```js 68 | { 69 | module: { 70 | loaders: [ 71 | { 72 | test: /\.html$/, 73 | loader: 'html-loader' 74 | }], 75 | }, 76 | plugins: [ 77 | new HtmlWebpackPlugin({ 78 | template: 'src/index.html' 79 | }) 80 | ] 81 | } 82 | ``` 83 | -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-1/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/appcache/dist/webpack-1/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-1/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports, __webpack_require__) { 46 | 47 | __webpack_require__(1); 48 | var h1 = document.createElement('h1'); 49 | h1.innerHTML = 'Hello world!'; 50 | document.body.appendChild(h1); 51 | 52 | 53 | /***/ }), 54 | /* 1 */ 55 | /***/ (function(module, exports) { 56 | 57 | // removed by extract-text-webpack-plugin 58 | 59 | /***/ }) 60 | /******/ ]); -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-1/index.html: -------------------------------------------------------------------------------- 1 | Example template -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-1/manifest.appcache: -------------------------------------------------------------------------------- 1 | CACHE MANIFEST 2 | # f688cbdde5a6e721015e 3 | 4 | 0714810ae3fb211173e2964249507195.png 5 | bundle.js 6 | styles.css 7 | 8 | NETWORK: 9 | * 10 | -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-1/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-2/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/appcache/dist/webpack-2/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-2/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // identity function for calling harmony imports with the correct context 37 | /******/ __webpack_require__.i = function(value) { return value; }; 38 | /******/ 39 | /******/ // define getter function for harmony exports 40 | /******/ __webpack_require__.d = function(exports, name, getter) { 41 | /******/ if(!__webpack_require__.o(exports, name)) { 42 | /******/ Object.defineProperty(exports, name, { 43 | /******/ configurable: false, 44 | /******/ enumerable: true, 45 | /******/ get: getter 46 | /******/ }); 47 | /******/ } 48 | /******/ }; 49 | /******/ 50 | /******/ // getDefaultExport function for compatibility with non-harmony modules 51 | /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = module && module.__esModule ? 53 | /******/ function getDefault() { return module['default']; } : 54 | /******/ function getModuleExports() { return module; }; 55 | /******/ __webpack_require__.d(getter, 'a', getter); 56 | /******/ return getter; 57 | /******/ }; 58 | /******/ 59 | /******/ // Object.prototype.hasOwnProperty.call 60 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61 | /******/ 62 | /******/ // __webpack_public_path__ 63 | /******/ __webpack_require__.p = ""; 64 | /******/ 65 | /******/ // Load entry module and return exports 66 | /******/ return __webpack_require__(__webpack_require__.s = 1); 67 | /******/ }) 68 | /************************************************************************/ 69 | /******/ ([ 70 | /* 0 */ 71 | /***/ (function(module, exports) { 72 | 73 | // removed by extract-text-webpack-plugin 74 | 75 | /***/ }), 76 | /* 1 */ 77 | /***/ (function(module, exports, __webpack_require__) { 78 | 79 | __webpack_require__(0); 80 | var h1 = document.createElement('h1'); 81 | h1.innerHTML = 'Hello world!'; 82 | document.body.appendChild(h1); 83 | 84 | 85 | /***/ }) 86 | /******/ ]); -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-2/index.html: -------------------------------------------------------------------------------- 1 | Example template -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-2/manifest.appcache: -------------------------------------------------------------------------------- 1 | CACHE MANIFEST 2 | # 737de2033617f9f6144d 3 | 4 | 0714810ae3fb211173e2964249507195.png 5 | bundle.js 6 | styles.css 7 | 8 | NETWORK: 9 | * 10 | -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-2/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-3/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/appcache/dist/webpack-3/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-3/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // getDefaultExport function for compatibility with non-harmony modules 48 | /******/ __webpack_require__.n = function(module) { 49 | /******/ var getter = module && module.__esModule ? 50 | /******/ function getDefault() { return module['default']; } : 51 | /******/ function getModuleExports() { return module; }; 52 | /******/ __webpack_require__.d(getter, 'a', getter); 53 | /******/ return getter; 54 | /******/ }; 55 | /******/ 56 | /******/ // Object.prototype.hasOwnProperty.call 57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58 | /******/ 59 | /******/ // __webpack_public_path__ 60 | /******/ __webpack_require__.p = ""; 61 | /******/ 62 | /******/ // Load entry module and return exports 63 | /******/ return __webpack_require__(__webpack_require__.s = 0); 64 | /******/ }) 65 | /************************************************************************/ 66 | /******/ ([ 67 | /* 0 */ 68 | /***/ (function(module, exports, __webpack_require__) { 69 | 70 | __webpack_require__(1); 71 | var h1 = document.createElement('h1'); 72 | h1.innerHTML = 'Hello world!'; 73 | document.body.appendChild(h1); 74 | 75 | 76 | /***/ }), 77 | /* 1 */ 78 | /***/ (function(module, exports) { 79 | 80 | // removed by extract-text-webpack-plugin 81 | 82 | /***/ }) 83 | /******/ ]); -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-3/index.html: -------------------------------------------------------------------------------- 1 | Example template -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-3/manifest.appcache: -------------------------------------------------------------------------------- 1 | CACHE MANIFEST 2 | # eda37a6c6de5fd0ecfbe 3 | 4 | 0714810ae3fb211173e2964249507195.png 5 | bundle.js 6 | styles.css 7 | 8 | NETWORK: 9 | * 10 | -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-3/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-4/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/appcache/dist/webpack-4/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-4/index.html: -------------------------------------------------------------------------------- 1 | Example template -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-4/manifest.appcache: -------------------------------------------------------------------------------- 1 | CACHE MANIFEST 2 | # 95a89258cd32fe3f01e3 3 | 4 | 0714810ae3fb211173e2964249507195.png 5 | bundle.js 6 | styles.css 7 | 8 | NETWORK: 9 | * 10 | -------------------------------------------------------------------------------- /examples/appcache/dist/webpack-4/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/appcache/example.js: -------------------------------------------------------------------------------- 1 | require('./main.css'); 2 | var h1 = document.createElement('h1'); 3 | h1.innerHTML = 'Hello world!'; 4 | document.body.appendChild(h1); 5 | -------------------------------------------------------------------------------- /examples/appcache/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/appcache/logo.png -------------------------------------------------------------------------------- /examples/appcache/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/appcache/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/appcache/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var AppCachePlugin = require('appcache-webpack-plugin'); 3 | var HtmlWebpackPlugin = require('../..'); 4 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 5 | var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; 6 | 7 | module.exports = { 8 | context: __dirname, 9 | entry: './example.js', 10 | output: { 11 | path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion), 12 | publicPath: '', 13 | filename: 'bundle.js' 14 | }, 15 | module: { 16 | loaders: [ 17 | { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }, 18 | { test: /\.png$/, loader: 'file-loader' }, 19 | { test: /\.html$/, loader: 'html-loader?-removeOptionalTags' } 20 | ] 21 | }, 22 | plugins: [ 23 | new AppCachePlugin(), 24 | new HtmlWebpackPlugin({ 25 | filename: 'index.html', 26 | template: 'template.html', 27 | minify: { 28 | removeComments: true, 29 | collapseWhitespace: true 30 | } 31 | }), 32 | new ExtractTextPlugin('styles.css') 33 | ] 34 | }; 35 | -------------------------------------------------------------------------------- /examples/build-examples.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is just a helper to compile all examples. 3 | * 4 | * You could do the same by going into each example and execute 5 | * `webpack` 6 | */ 7 | var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; 8 | 9 | var fs = require('fs'); 10 | var path = require('path'); 11 | var rimraf = require('rimraf'); 12 | var webpack = require('webpack'); 13 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 14 | 15 | if (Number(webpackMajorVersion) > 1) { 16 | var extractOriginal = ExtractTextPlugin.extract; 17 | ExtractTextPlugin.extract = function (fallback, use) { 18 | return extractOriginal({ 19 | fallback: fallback, 20 | use: use 21 | }); 22 | }; 23 | } 24 | 25 | var examples = fs.readdirSync(__dirname).filter(function (file) { 26 | return fs.statSync(path.join(__dirname, file)).isDirectory(); 27 | }); 28 | 29 | examples.forEach(function (exampleName) { 30 | var examplePath = path.join(__dirname, exampleName); 31 | var configFile = path.join(examplePath, 'webpack.config.js'); 32 | 33 | var config = require(configFile); 34 | if (webpackMajorVersion === '4') { 35 | config.plugins.unshift(new webpack.LoaderOptionsPlugin({ 36 | options: { 37 | context: process.cwd() // or the same value as `context` 38 | } 39 | })); 40 | config.mode = 'production'; 41 | config.optimization = { minimizer: [] }; 42 | if (config.module && config.module.loaders) { 43 | config.module.rules = config.module.loaders; 44 | delete config.module.loaders; 45 | } 46 | } 47 | 48 | rimraf.sync(path.join(examplePath, 'dist', 'webpack-' + webpackMajorVersion)); 49 | webpack(config, function (err, stats) { 50 | if (err) { 51 | console.error(err.stack || err); 52 | if (err.details) { 53 | console.error(err.details); 54 | } 55 | return; 56 | } 57 | 58 | const info = stats.toJson(); 59 | 60 | if (stats.hasErrors()) { 61 | console.error(info.errors); 62 | } 63 | 64 | if (stats.hasWarnings()) { 65 | console.warn(info.warnings); 66 | } 67 | }); 68 | }); 69 | -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-1/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/custom-template/dist/webpack-1/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-1/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports, __webpack_require__) { 46 | 47 | __webpack_require__(1); 48 | var h1 = document.createElement('h1'); 49 | h1.innerHTML = 'Hello world!'; 50 | document.body.appendChild(h1); 51 | 52 | 53 | /***/ }), 54 | /* 1 */ 55 | /***/ (function(module, exports) { 56 | 57 | // removed by extract-text-webpack-plugin 58 | 59 | /***/ }) 60 | /******/ ]); -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Webpack App 6 | 7 | 8 | 9 |

Partial

10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-1/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-2/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/custom-template/dist/webpack-2/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-2/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // identity function for calling harmony imports with the correct context 37 | /******/ __webpack_require__.i = function(value) { return value; }; 38 | /******/ 39 | /******/ // define getter function for harmony exports 40 | /******/ __webpack_require__.d = function(exports, name, getter) { 41 | /******/ if(!__webpack_require__.o(exports, name)) { 42 | /******/ Object.defineProperty(exports, name, { 43 | /******/ configurable: false, 44 | /******/ enumerable: true, 45 | /******/ get: getter 46 | /******/ }); 47 | /******/ } 48 | /******/ }; 49 | /******/ 50 | /******/ // getDefaultExport function for compatibility with non-harmony modules 51 | /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = module && module.__esModule ? 53 | /******/ function getDefault() { return module['default']; } : 54 | /******/ function getModuleExports() { return module; }; 55 | /******/ __webpack_require__.d(getter, 'a', getter); 56 | /******/ return getter; 57 | /******/ }; 58 | /******/ 59 | /******/ // Object.prototype.hasOwnProperty.call 60 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61 | /******/ 62 | /******/ // __webpack_public_path__ 63 | /******/ __webpack_require__.p = ""; 64 | /******/ 65 | /******/ // Load entry module and return exports 66 | /******/ return __webpack_require__(__webpack_require__.s = 1); 67 | /******/ }) 68 | /************************************************************************/ 69 | /******/ ([ 70 | /* 0 */ 71 | /***/ (function(module, exports) { 72 | 73 | // removed by extract-text-webpack-plugin 74 | 75 | /***/ }), 76 | /* 1 */ 77 | /***/ (function(module, exports, __webpack_require__) { 78 | 79 | __webpack_require__(0); 80 | var h1 = document.createElement('h1'); 81 | h1.innerHTML = 'Hello world!'; 82 | document.body.appendChild(h1); 83 | 84 | 85 | /***/ }) 86 | /******/ ]); -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Webpack App 6 | 7 | 8 | 9 |

Partial

10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-2/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-3/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/custom-template/dist/webpack-3/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-3/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // getDefaultExport function for compatibility with non-harmony modules 48 | /******/ __webpack_require__.n = function(module) { 49 | /******/ var getter = module && module.__esModule ? 50 | /******/ function getDefault() { return module['default']; } : 51 | /******/ function getModuleExports() { return module; }; 52 | /******/ __webpack_require__.d(getter, 'a', getter); 53 | /******/ return getter; 54 | /******/ }; 55 | /******/ 56 | /******/ // Object.prototype.hasOwnProperty.call 57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58 | /******/ 59 | /******/ // __webpack_public_path__ 60 | /******/ __webpack_require__.p = ""; 61 | /******/ 62 | /******/ // Load entry module and return exports 63 | /******/ return __webpack_require__(__webpack_require__.s = 0); 64 | /******/ }) 65 | /************************************************************************/ 66 | /******/ ([ 67 | /* 0 */ 68 | /***/ (function(module, exports, __webpack_require__) { 69 | 70 | __webpack_require__(1); 71 | var h1 = document.createElement('h1'); 72 | h1.innerHTML = 'Hello world!'; 73 | document.body.appendChild(h1); 74 | 75 | 76 | /***/ }), 77 | /* 1 */ 78 | /***/ (function(module, exports) { 79 | 80 | // removed by extract-text-webpack-plugin 81 | 82 | /***/ }) 83 | /******/ ]); -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Webpack App 6 | 7 | 8 | 9 |

Partial

10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-3/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-4/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/custom-template/dist/webpack-4/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Webpack App 6 | 7 | 8 | 9 |

Partial

10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/custom-template/dist/webpack-4/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/custom-template/example.js: -------------------------------------------------------------------------------- 1 | require('./main.css'); 2 | var h1 = document.createElement('h1'); 3 | h1.innerHTML = 'Hello world!'; 4 | document.body.appendChild(h1); 5 | -------------------------------------------------------------------------------- /examples/custom-template/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/custom-template/logo.png -------------------------------------------------------------------------------- /examples/custom-template/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/custom-template/partial.html: -------------------------------------------------------------------------------- 1 |

Partial

2 | -------------------------------------------------------------------------------- /examples/custom-template/readme.md: -------------------------------------------------------------------------------- 1 | # custom template 2 | 3 | This example uses a custom underscore template which inlines an partial using the html-loader: 4 | `<%= require('html-loader!./partial.html') %>` 5 | -------------------------------------------------------------------------------- /examples/custom-template/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%= htmlWebpackPlugin.options.title %> 6 | 7 | 8 | 9 | <%= require('html-loader!./partial.html') %> 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/custom-template/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var HtmlWebpackPlugin = require('../..'); 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 4 | var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; 5 | 6 | module.exports = { 7 | context: __dirname, 8 | entry: './example.js', 9 | output: { 10 | path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion), 11 | publicPath: '', 12 | filename: 'bundle.js' 13 | }, 14 | module: { 15 | loaders: [ 16 | { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }, 17 | { test: /\.png$/, loader: 'file-loader' } 18 | ] 19 | }, 20 | plugins: [ 21 | new HtmlWebpackPlugin({ 22 | template: 'template.html' 23 | }), 24 | new ExtractTextPlugin('styles.css') 25 | ] 26 | }; 27 | -------------------------------------------------------------------------------- /examples/default/dist/webpack-1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Webpack App 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/default/dist/webpack-2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Webpack App 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/default/dist/webpack-3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Webpack App 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/default/dist/webpack-4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Webpack App 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/default/example.js: -------------------------------------------------------------------------------- 1 | require('./main.css'); 2 | var h1 = document.createElement('h1'); 3 | h1.innerHTML = 'Hello world!'; 4 | document.body.appendChild(h1); 5 | -------------------------------------------------------------------------------- /examples/default/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/default/readme.md: -------------------------------------------------------------------------------- 1 | # zero-config example 2 | 3 | in this example only the default configuration is used -------------------------------------------------------------------------------- /examples/default/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var HtmlWebpackPlugin = require('../..'); 3 | var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; 4 | module.exports = { 5 | context: __dirname, 6 | entry: './example.js', 7 | output: { 8 | path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion), 9 | publicPath: '', 10 | filename: 'bundle.js' 11 | }, 12 | module: { 13 | loaders: [ 14 | { test: /\.css$/, loader: 'style-loader!css-loader' }, 15 | { test: /\.png$/, loader: 'file-loader' } 16 | ] 17 | }, 18 | plugins: [ 19 | new HtmlWebpackPlugin() 20 | ] 21 | }; 22 | -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-1/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports, __webpack_require__) { 46 | 47 | __webpack_require__(1); 48 | var h1 = document.createElement('h1'); 49 | h1.innerHTML = 'Hello world!'; 50 | document.body.appendChild(h1); 51 | 52 | 53 | /***/ }), 54 | /* 1 */ 55 | /***/ (function(module, exports) { 56 | 57 | // removed by extract-text-webpack-plugin 58 | 59 | /***/ }) 60 | /******/ ]); -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-1/favicon.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HtmlWebpackPlugin example 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-1/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/favicon/dist/webpack-1/favicon.ico -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-1/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-2/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // identity function for calling harmony imports with the correct context 37 | /******/ __webpack_require__.i = function(value) { return value; }; 38 | /******/ 39 | /******/ // define getter function for harmony exports 40 | /******/ __webpack_require__.d = function(exports, name, getter) { 41 | /******/ if(!__webpack_require__.o(exports, name)) { 42 | /******/ Object.defineProperty(exports, name, { 43 | /******/ configurable: false, 44 | /******/ enumerable: true, 45 | /******/ get: getter 46 | /******/ }); 47 | /******/ } 48 | /******/ }; 49 | /******/ 50 | /******/ // getDefaultExport function for compatibility with non-harmony modules 51 | /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = module && module.__esModule ? 53 | /******/ function getDefault() { return module['default']; } : 54 | /******/ function getModuleExports() { return module; }; 55 | /******/ __webpack_require__.d(getter, 'a', getter); 56 | /******/ return getter; 57 | /******/ }; 58 | /******/ 59 | /******/ // Object.prototype.hasOwnProperty.call 60 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61 | /******/ 62 | /******/ // __webpack_public_path__ 63 | /******/ __webpack_require__.p = ""; 64 | /******/ 65 | /******/ // Load entry module and return exports 66 | /******/ return __webpack_require__(__webpack_require__.s = 1); 67 | /******/ }) 68 | /************************************************************************/ 69 | /******/ ([ 70 | /* 0 */ 71 | /***/ (function(module, exports) { 72 | 73 | // removed by extract-text-webpack-plugin 74 | 75 | /***/ }), 76 | /* 1 */ 77 | /***/ (function(module, exports, __webpack_require__) { 78 | 79 | __webpack_require__(0); 80 | var h1 = document.createElement('h1'); 81 | h1.innerHTML = 'Hello world!'; 82 | document.body.appendChild(h1); 83 | 84 | 85 | /***/ }) 86 | /******/ ]); -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-2/favicon.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HtmlWebpackPlugin example 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-2/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/favicon/dist/webpack-2/favicon.ico -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-2/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-3/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // getDefaultExport function for compatibility with non-harmony modules 48 | /******/ __webpack_require__.n = function(module) { 49 | /******/ var getter = module && module.__esModule ? 50 | /******/ function getDefault() { return module['default']; } : 51 | /******/ function getModuleExports() { return module; }; 52 | /******/ __webpack_require__.d(getter, 'a', getter); 53 | /******/ return getter; 54 | /******/ }; 55 | /******/ 56 | /******/ // Object.prototype.hasOwnProperty.call 57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58 | /******/ 59 | /******/ // __webpack_public_path__ 60 | /******/ __webpack_require__.p = ""; 61 | /******/ 62 | /******/ // Load entry module and return exports 63 | /******/ return __webpack_require__(__webpack_require__.s = 0); 64 | /******/ }) 65 | /************************************************************************/ 66 | /******/ ([ 67 | /* 0 */ 68 | /***/ (function(module, exports, __webpack_require__) { 69 | 70 | __webpack_require__(1); 71 | var h1 = document.createElement('h1'); 72 | h1.innerHTML = 'Hello world!'; 73 | document.body.appendChild(h1); 74 | 75 | 76 | /***/ }), 77 | /* 1 */ 78 | /***/ (function(module, exports) { 79 | 80 | // removed by extract-text-webpack-plugin 81 | 82 | /***/ }) 83 | /******/ ]); -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-3/favicon.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HtmlWebpackPlugin example 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-3/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/favicon/dist/webpack-3/favicon.ico -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-3/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-4/favicon.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HtmlWebpackPlugin example 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-4/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/favicon/dist/webpack-4/favicon.ico -------------------------------------------------------------------------------- /examples/favicon/dist/webpack-4/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/favicon/example.js: -------------------------------------------------------------------------------- 1 | require('./main.css'); 2 | var h1 = document.createElement('h1'); 3 | h1.innerHTML = 'Hello world!'; 4 | document.body.appendChild(h1); 5 | -------------------------------------------------------------------------------- /examples/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/favicon/favicon.ico -------------------------------------------------------------------------------- /examples/favicon/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/favicon/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/favicon/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var HtmlWebpackPlugin = require('../..'); 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 4 | var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; 5 | module.exports = { 6 | context: __dirname, 7 | entry: './example.js', 8 | output: { 9 | path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion), 10 | publicPath: '', 11 | filename: 'bundle.js' 12 | }, 13 | module: { 14 | loaders: [ 15 | { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }, 16 | { test: /\.png$/, loader: 'file-loader' } 17 | ] 18 | }, 19 | plugins: [ 20 | new HtmlWebpackPlugin({ 21 | title: 'HtmlWebpackPlugin example', 22 | favicon: 'favicon.ico', 23 | filename: 'favicon.html' 24 | }), 25 | new ExtractTextPlugin('styles.css') 26 | ] 27 | }; 28 | -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-1/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/html-loader/dist/webpack-1/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-1/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-1/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports, __webpack_require__) { 46 | 47 | __webpack_require__(1); 48 | var h1 = document.createElement('h1'); 49 | h1.innerHTML = 'Hello world!'; 50 | document.body.appendChild(h1); 51 | 52 | 53 | /***/ }), 54 | /* 1 */ 55 | /***/ (function(module, exports) { 56 | 57 | // removed by extract-text-webpack-plugin 58 | 59 | /***/ }) 60 | /******/ ]); -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-1/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/html-loader/dist/webpack-1/favicon.ico -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-1/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-2/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/html-loader/dist/webpack-2/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-2/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-2/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // identity function for calling harmony imports with the correct context 37 | /******/ __webpack_require__.i = function(value) { return value; }; 38 | /******/ 39 | /******/ // define getter function for harmony exports 40 | /******/ __webpack_require__.d = function(exports, name, getter) { 41 | /******/ if(!__webpack_require__.o(exports, name)) { 42 | /******/ Object.defineProperty(exports, name, { 43 | /******/ configurable: false, 44 | /******/ enumerable: true, 45 | /******/ get: getter 46 | /******/ }); 47 | /******/ } 48 | /******/ }; 49 | /******/ 50 | /******/ // getDefaultExport function for compatibility with non-harmony modules 51 | /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = module && module.__esModule ? 53 | /******/ function getDefault() { return module['default']; } : 54 | /******/ function getModuleExports() { return module; }; 55 | /******/ __webpack_require__.d(getter, 'a', getter); 56 | /******/ return getter; 57 | /******/ }; 58 | /******/ 59 | /******/ // Object.prototype.hasOwnProperty.call 60 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61 | /******/ 62 | /******/ // __webpack_public_path__ 63 | /******/ __webpack_require__.p = ""; 64 | /******/ 65 | /******/ // Load entry module and return exports 66 | /******/ return __webpack_require__(__webpack_require__.s = 1); 67 | /******/ }) 68 | /************************************************************************/ 69 | /******/ ([ 70 | /* 0 */ 71 | /***/ (function(module, exports) { 72 | 73 | // removed by extract-text-webpack-plugin 74 | 75 | /***/ }), 76 | /* 1 */ 77 | /***/ (function(module, exports, __webpack_require__) { 78 | 79 | __webpack_require__(0); 80 | var h1 = document.createElement('h1'); 81 | h1.innerHTML = 'Hello world!'; 82 | document.body.appendChild(h1); 83 | 84 | 85 | /***/ }) 86 | /******/ ]); -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-2/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/html-loader/dist/webpack-2/favicon.ico -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-2/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-3/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/html-loader/dist/webpack-3/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-3/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-3/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // getDefaultExport function for compatibility with non-harmony modules 48 | /******/ __webpack_require__.n = function(module) { 49 | /******/ var getter = module && module.__esModule ? 50 | /******/ function getDefault() { return module['default']; } : 51 | /******/ function getModuleExports() { return module; }; 52 | /******/ __webpack_require__.d(getter, 'a', getter); 53 | /******/ return getter; 54 | /******/ }; 55 | /******/ 56 | /******/ // Object.prototype.hasOwnProperty.call 57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58 | /******/ 59 | /******/ // __webpack_public_path__ 60 | /******/ __webpack_require__.p = ""; 61 | /******/ 62 | /******/ // Load entry module and return exports 63 | /******/ return __webpack_require__(__webpack_require__.s = 0); 64 | /******/ }) 65 | /************************************************************************/ 66 | /******/ ([ 67 | /* 0 */ 68 | /***/ (function(module, exports, __webpack_require__) { 69 | 70 | __webpack_require__(1); 71 | var h1 = document.createElement('h1'); 72 | h1.innerHTML = 'Hello world!'; 73 | document.body.appendChild(h1); 74 | 75 | 76 | /***/ }), 77 | /* 1 */ 78 | /***/ (function(module, exports) { 79 | 80 | // removed by extract-text-webpack-plugin 81 | 82 | /***/ }) 83 | /******/ ]); -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-3/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/html-loader/dist/webpack-3/favicon.ico -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-3/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-4/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/html-loader/dist/webpack-4/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-4/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-4/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/html-loader/dist/webpack-4/favicon.ico -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/html-loader/dist/webpack-4/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/html-loader/example.js: -------------------------------------------------------------------------------- 1 | require('./main.css'); 2 | var h1 = document.createElement('h1'); 3 | h1.innerHTML = 'Hello world!'; 4 | document.body.appendChild(h1); 5 | -------------------------------------------------------------------------------- /examples/html-loader/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/html-loader/favicon.ico -------------------------------------------------------------------------------- /examples/html-loader/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/html-loader/logo.png -------------------------------------------------------------------------------- /examples/html-loader/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/html-loader/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/html-loader/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var HtmlWebpackPlugin = require('../..'); 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 4 | var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; 5 | module.exports = { 6 | context: __dirname, 7 | entry: './example.js', 8 | output: { 9 | path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion), 10 | publicPath: '', 11 | filename: 'bundle.js' 12 | }, 13 | module: { 14 | loaders: [ 15 | { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }, 16 | { test: /\.png$/, loader: 'file-loader' }, 17 | { test: /\.html$/, loader: 'html-loader' } 18 | ] 19 | }, 20 | plugins: [ 21 | new HtmlWebpackPlugin({ 22 | filename: 'index.html', 23 | favicon: 'favicon.ico', 24 | template: 'template.html' 25 | }), 26 | new HtmlWebpackPlugin({ 27 | filename: 'about.html', 28 | favicon: 'favicon.ico', 29 | template: 'template.html' 30 | }), 31 | new ExtractTextPlugin('styles.css') 32 | ] 33 | }; 34 | -------------------------------------------------------------------------------- /examples/inline/dist/webpack-1/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports, __webpack_require__) { 46 | 47 | 'use strict'; 48 | __webpack_require__(1); 49 | 50 | console.log('Hello World'); 51 | 52 | 53 | /***/ }), 54 | /* 1 */ 55 | /***/ (function(module, exports) { 56 | 57 | // removed by extract-text-webpack-plugin 58 | 59 | /***/ }) 60 | /******/ ]); -------------------------------------------------------------------------------- /examples/inline/dist/webpack-1/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/inline/dist/webpack-1/favicon.ico -------------------------------------------------------------------------------- /examples/inline/dist/webpack-1/index.html: -------------------------------------------------------------------------------- 1 | Jade demo -------------------------------------------------------------------------------- /examples/inline/dist/webpack-1/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/inline/dist/webpack-2/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // identity function for calling harmony imports with the correct context 37 | /******/ __webpack_require__.i = function(value) { return value; }; 38 | /******/ 39 | /******/ // define getter function for harmony exports 40 | /******/ __webpack_require__.d = function(exports, name, getter) { 41 | /******/ if(!__webpack_require__.o(exports, name)) { 42 | /******/ Object.defineProperty(exports, name, { 43 | /******/ configurable: false, 44 | /******/ enumerable: true, 45 | /******/ get: getter 46 | /******/ }); 47 | /******/ } 48 | /******/ }; 49 | /******/ 50 | /******/ // getDefaultExport function for compatibility with non-harmony modules 51 | /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = module && module.__esModule ? 53 | /******/ function getDefault() { return module['default']; } : 54 | /******/ function getModuleExports() { return module; }; 55 | /******/ __webpack_require__.d(getter, 'a', getter); 56 | /******/ return getter; 57 | /******/ }; 58 | /******/ 59 | /******/ // Object.prototype.hasOwnProperty.call 60 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61 | /******/ 62 | /******/ // __webpack_public_path__ 63 | /******/ __webpack_require__.p = ""; 64 | /******/ 65 | /******/ // Load entry module and return exports 66 | /******/ return __webpack_require__(__webpack_require__.s = 1); 67 | /******/ }) 68 | /************************************************************************/ 69 | /******/ ([ 70 | /* 0 */ 71 | /***/ (function(module, exports) { 72 | 73 | // removed by extract-text-webpack-plugin 74 | 75 | /***/ }), 76 | /* 1 */ 77 | /***/ (function(module, exports, __webpack_require__) { 78 | 79 | "use strict"; 80 | 81 | __webpack_require__(0); 82 | 83 | console.log('Hello World'); 84 | 85 | 86 | /***/ }) 87 | /******/ ]); -------------------------------------------------------------------------------- /examples/inline/dist/webpack-2/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/inline/dist/webpack-2/favicon.ico -------------------------------------------------------------------------------- /examples/inline/dist/webpack-2/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/inline/dist/webpack-3/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // getDefaultExport function for compatibility with non-harmony modules 48 | /******/ __webpack_require__.n = function(module) { 49 | /******/ var getter = module && module.__esModule ? 50 | /******/ function getDefault() { return module['default']; } : 51 | /******/ function getModuleExports() { return module; }; 52 | /******/ __webpack_require__.d(getter, 'a', getter); 53 | /******/ return getter; 54 | /******/ }; 55 | /******/ 56 | /******/ // Object.prototype.hasOwnProperty.call 57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58 | /******/ 59 | /******/ // __webpack_public_path__ 60 | /******/ __webpack_require__.p = ""; 61 | /******/ 62 | /******/ // Load entry module and return exports 63 | /******/ return __webpack_require__(__webpack_require__.s = 0); 64 | /******/ }) 65 | /************************************************************************/ 66 | /******/ ([ 67 | /* 0 */ 68 | /***/ (function(module, exports, __webpack_require__) { 69 | 70 | "use strict"; 71 | 72 | __webpack_require__(1); 73 | 74 | console.log('Hello World'); 75 | 76 | 77 | /***/ }), 78 | /* 1 */ 79 | /***/ (function(module, exports) { 80 | 81 | // removed by extract-text-webpack-plugin 82 | 83 | /***/ }) 84 | /******/ ]); -------------------------------------------------------------------------------- /examples/inline/dist/webpack-3/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/inline/dist/webpack-3/favicon.ico -------------------------------------------------------------------------------- /examples/inline/dist/webpack-3/index.html: -------------------------------------------------------------------------------- 1 | Jade demo -------------------------------------------------------------------------------- /examples/inline/dist/webpack-3/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/inline/dist/webpack-4/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // define __esModule on exports 48 | /******/ __webpack_require__.r = function(exports) { 49 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 50 | /******/ }; 51 | /******/ 52 | /******/ // getDefaultExport function for compatibility with non-harmony modules 53 | /******/ __webpack_require__.n = function(module) { 54 | /******/ var getter = module && module.__esModule ? 55 | /******/ function getDefault() { return module['default']; } : 56 | /******/ function getModuleExports() { return module; }; 57 | /******/ __webpack_require__.d(getter, 'a', getter); 58 | /******/ return getter; 59 | /******/ }; 60 | /******/ 61 | /******/ // Object.prototype.hasOwnProperty.call 62 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 63 | /******/ 64 | /******/ // __webpack_public_path__ 65 | /******/ __webpack_require__.p = ""; 66 | /******/ 67 | /******/ 68 | /******/ // Load entry module and return exports 69 | /******/ return __webpack_require__(__webpack_require__.s = 0); 70 | /******/ }) 71 | /************************************************************************/ 72 | /******/ ([ 73 | /* 0 */ 74 | /***/ (function(module, exports, __webpack_require__) { 75 | 76 | "use strict"; 77 | 78 | __webpack_require__(4); 79 | 80 | console.log('Hello World'); 81 | 82 | 83 | /***/ }), 84 | /* 1 */, 85 | /* 2 */, 86 | /* 3 */, 87 | /* 4 */ 88 | /***/ (function(module, exports) { 89 | 90 | // removed by extract-text-webpack-plugin 91 | 92 | /***/ }) 93 | /******/ ]); -------------------------------------------------------------------------------- /examples/inline/dist/webpack-4/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/inline/dist/webpack-4/favicon.ico -------------------------------------------------------------------------------- /examples/inline/dist/webpack-4/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/inline/example.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | require('./main.css'); 3 | 4 | console.log('Hello World'); 5 | -------------------------------------------------------------------------------- /examples/inline/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/inline/favicon.ico -------------------------------------------------------------------------------- /examples/inline/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/inline/readme.md: -------------------------------------------------------------------------------- 1 | # isomorphic jade example 2 | 3 | This example shows how to use a different template engine (in this case jade) 4 | to load the `time.jade` template on the backend and frontend. 5 | -------------------------------------------------------------------------------- /examples/inline/template.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | meta(http-equiv="Content-type" content="text/html; charset=utf-8") 5 | title #{htmlWebpackPlugin.options.title} 6 | body 7 | each cssFile in htmlWebpackPlugin.files.css 8 | style !{compilation.assets[cssFile.substr(htmlWebpackPlugin.files.publicPath.length)].source()} 9 | each jsFile in htmlWebpackPlugin.files.js 10 | script(type="text/javascript") !{compilation.assets[jsFile.substr(htmlWebpackPlugin.files.publicPath.length)].source()} 11 | -------------------------------------------------------------------------------- /examples/inline/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var HtmlWebpackPlugin = require('../..'); 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 4 | var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; 5 | 6 | module.exports = { 7 | context: __dirname, 8 | entry: './example.js', 9 | output: { 10 | path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion), 11 | publicPath: '', 12 | filename: 'bundle.js' 13 | }, 14 | module: { 15 | loaders: [ 16 | { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }, 17 | { test: /\.jade$/, loader: 'jade-loader' } 18 | ] 19 | }, 20 | plugins: [ 21 | new HtmlWebpackPlugin({ 22 | inject: false, 23 | cache: false, 24 | template: 'template.jade', 25 | filename: 'index.html', 26 | favicon: 'favicon.ico', 27 | title: 'Jade demo' 28 | }), 29 | new ExtractTextPlugin('styles.css') 30 | ] 31 | }; 32 | -------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-1/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/jade-loader/dist/webpack-1/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-1/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/jade-loader/dist/webpack-1/favicon.ico -------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-1/index.html: -------------------------------------------------------------------------------- 1 | Jade demo
Current time

1998-12-31T23:00:00.000Z

-------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-1/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-2/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/jade-loader/dist/webpack-2/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-2/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/jade-loader/dist/webpack-2/favicon.ico -------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-2/index.html: -------------------------------------------------------------------------------- 1 | Jade demo
Current time

1998-12-31T23:00:00.000Z

-------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-2/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-3/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/jade-loader/dist/webpack-3/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-3/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/jade-loader/dist/webpack-3/favicon.ico -------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-3/index.html: -------------------------------------------------------------------------------- 1 | Jade demo
Current time

1999-01-01T00:00:00.000Z

-------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-3/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-4/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/jade-loader/dist/webpack-4/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-4/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/jade-loader/dist/webpack-4/favicon.ico -------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-4/index.html: -------------------------------------------------------------------------------- 1 | Jade demo
Current time

1999-01-01T05:00:00.000Z

-------------------------------------------------------------------------------- /examples/jade-loader/dist/webpack-4/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/jade-loader/example.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | require('./main.css'); 3 | // Use the same template for the frontend code 4 | var template = require('./time.jade'); 5 | 6 | setInterval(function () { 7 | var div = document.getElementById('main'); 8 | div.innerHTML = template({ time: new Date() }); 9 | div.style.color = 'navy'; 10 | }, 1000); 11 | -------------------------------------------------------------------------------- /examples/jade-loader/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/jade-loader/favicon.ico -------------------------------------------------------------------------------- /examples/jade-loader/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/jade-loader/logo.png -------------------------------------------------------------------------------- /examples/jade-loader/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/jade-loader/readme.md: -------------------------------------------------------------------------------- 1 | # isomorphic jade example 2 | 3 | This example shows how to use a different template engine (in this case jade) 4 | to load the `time.jade` template on the backend and frontend. 5 | -------------------------------------------------------------------------------- /examples/jade-loader/template.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= htmlWebpackPlugin.options.title 5 | body 6 | #main 7 | - locals.time = new Date('01 01, 1999'); 8 | include ./time.jade -------------------------------------------------------------------------------- /examples/jade-loader/time.jade: -------------------------------------------------------------------------------- 1 | // this partial is used for frontend and backend 2 | .time 3 | b Current time 4 | p #{time.toISOString()} 5 | 6 | img(src="#{require('./logo.png')}") -------------------------------------------------------------------------------- /examples/jade-loader/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var HtmlWebpackPlugin = require('../..'); 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 4 | var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; 5 | module.exports = { 6 | context: __dirname, 7 | entry: './example.js', 8 | output: { 9 | path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion), 10 | publicPath: '', 11 | filename: 'bundle.js' 12 | }, 13 | module: { 14 | loaders: [ 15 | { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }, 16 | { test: /\.png$/, loader: 'file-loader' }, 17 | { test: /\.jade$/, loader: 'jade-loader' } 18 | ] 19 | }, 20 | plugins: [ 21 | new HtmlWebpackPlugin({ 22 | filename: 'index.html', 23 | favicon: 'favicon.ico', 24 | template: 'template.jade', 25 | title: 'Jade demo' 26 | }), 27 | new ExtractTextPlugin('styles.css') 28 | ] 29 | }; 30 | -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-1/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/javascript-advanced/dist/webpack-1/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-1/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports, __webpack_require__) { 46 | 47 | eval("__webpack_require__(1);\n\nvar universal = __webpack_require__(5);\nvar h1 = document.createElement('h1');\nh1.innerHTML = universal();\n\ndocument.body.appendChild(h1);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./example.js\n// module id = 0\n// module chunks = 0\n//# sourceURL=webpack:///./example.js?"); 48 | 49 | /***/ }), 50 | /* 1 */ 51 | /***/ (function(module, exports) { 52 | 53 | eval("// removed by extract-text-webpack-plugin\n\n//////////////////\n// WEBPACK FOOTER\n// ./main.css\n// module id = 1\n// module chunks = 0\n//# sourceURL=webpack:///./main.css?"); 54 | 55 | /***/ }), 56 | /* 2 */, 57 | /* 3 */, 58 | /* 4 */, 59 | /* 5 */ 60 | /***/ (function(module, exports) { 61 | 62 | eval("// This file is used for frontend and backend\n'use strict';\n\n// If compiled by the html-webpack-plugin\n// HTML_WEBPACK_PLUGIN is set to true:\nvar backend = typeof HTML_WEBPACK_PLUGIN !== 'undefined';\n\nmodule.exports = function () {\n return 'Hello World from ' + (backend ? 'backend' : 'frontend');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./universial.js\n// module id = 5\n// module chunks = 0\n//# sourceURL=webpack:///./universial.js?"); 63 | 64 | /***/ }) 65 | /******/ ]); -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-1/index.html: -------------------------------------------------------------------------------- 1 | Webpack AppHello World from backend -

Partial

2 | -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-1/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-2/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/javascript-advanced/dist/webpack-2/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-2/index.html: -------------------------------------------------------------------------------- 1 | Webpack AppHello World from backend -

Partial

2 | -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-2/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-3/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/javascript-advanced/dist/webpack-3/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-3/index.html: -------------------------------------------------------------------------------- 1 | Webpack AppHello World from backend -

Partial

2 | -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-3/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-4/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/javascript-advanced/dist/webpack-4/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-4/index.html: -------------------------------------------------------------------------------- 1 | Webpack AppHello World from backend -

Partial

2 | -------------------------------------------------------------------------------- /examples/javascript-advanced/dist/webpack-4/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/javascript-advanced/example.js: -------------------------------------------------------------------------------- 1 | require('./main.css'); 2 | 3 | var universal = require('./universial.js'); 4 | var h1 = document.createElement('h1'); 5 | h1.innerHTML = universal(); 6 | 7 | document.body.appendChild(h1); 8 | -------------------------------------------------------------------------------- /examples/javascript-advanced/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/javascript-advanced/logo.png -------------------------------------------------------------------------------- /examples/javascript-advanced/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/javascript-advanced/partial.html: -------------------------------------------------------------------------------- 1 |

Partial

2 | -------------------------------------------------------------------------------- /examples/javascript-advanced/readme.md: -------------------------------------------------------------------------------- 1 | # isomorphic javascript-advanced example 2 | 3 | This example is similar to the javascript example however it allows takes 4 | parameters from the config and works asynchronously -------------------------------------------------------------------------------- /examples/javascript-advanced/template.js: -------------------------------------------------------------------------------- 1 | // Webpack require: 2 | var partial = require('./partial.html'); 3 | var universal = require('./universial.js'); 4 | 5 | // Export a function / promise / or a string: 6 | // This function has to return a string or promised string: 7 | module.exports = function (templateParams) { 8 | var html = '' + 9 | '' + templateParams.htmlWebpackPlugin.options.title + '' + 10 | '' + universal() + ' - ' + partial + ''; 11 | 12 | return html; 13 | }; 14 | -------------------------------------------------------------------------------- /examples/javascript-advanced/universial.js: -------------------------------------------------------------------------------- 1 | // This file is used for frontend and backend 2 | 'use strict'; 3 | 4 | // If compiled by the html-webpack-plugin 5 | // HTML_WEBPACK_PLUGIN is set to true: 6 | var backend = typeof HTML_WEBPACK_PLUGIN !== 'undefined'; 7 | 8 | module.exports = function () { 9 | return 'Hello World from ' + (backend ? 'backend' : 'frontend'); 10 | }; 11 | -------------------------------------------------------------------------------- /examples/javascript-advanced/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var HtmlWebpackPlugin = require('../..'); 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 4 | var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; 5 | module.exports = { 6 | context: __dirname, 7 | entry: './example.js', 8 | output: { 9 | path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion), 10 | publicPath: '', 11 | filename: 'bundle.js' 12 | }, 13 | module: { 14 | loaders: [ 15 | { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }, 16 | { test: /\.png$/, loader: 'file-loader' }, 17 | { test: /\.html$/, loader: 'html-loader' } 18 | ] 19 | }, 20 | devtool: 'eval', 21 | plugins: [ 22 | new HtmlWebpackPlugin({ 23 | template: 'template.js' 24 | }), 25 | new ExtractTextPlugin('styles.css') 26 | ] 27 | }; 28 | -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-1/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/javascript/dist/webpack-1/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-1/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports, __webpack_require__) { 46 | 47 | eval("__webpack_require__(1);\n\nvar universal = __webpack_require__(5);\nvar h1 = document.createElement('h1');\nh1.innerHTML = universal();\n\ndocument.body.appendChild(h1);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./example.js\n// module id = 0\n// module chunks = 0\n//# sourceURL=webpack:///./example.js?"); 48 | 49 | /***/ }), 50 | /* 1 */ 51 | /***/ (function(module, exports) { 52 | 53 | eval("// removed by extract-text-webpack-plugin\n\n//////////////////\n// WEBPACK FOOTER\n// ./main.css\n// module id = 1\n// module chunks = 0\n//# sourceURL=webpack:///./main.css?"); 54 | 55 | /***/ }), 56 | /* 2 */, 57 | /* 3 */, 58 | /* 4 */, 59 | /* 5 */ 60 | /***/ (function(module, exports) { 61 | 62 | eval("// This file is used for frontend and backend\n'use strict';\n\n// If compiled by the html-webpack-plugin\n// HTML_WEBPACK_PLUGIN is set to true:\nvar backend = typeof HTML_WEBPACK_PLUGIN !== 'undefined';\n\nmodule.exports = function () {\n return 'Hello World from ' + (backend ? 'backend' : 'frontend');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./universial.js\n// module id = 5\n// module chunks = 0\n//# sourceURL=webpack:///./universial.js?"); 63 | 64 | /***/ }) 65 | /******/ ]); -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-1/index.html: -------------------------------------------------------------------------------- 1 | Hello World from backend2017-04-17T17:13:11.491Z

Partial

2 | -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-1/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-2/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/javascript/dist/webpack-2/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-2/index.html: -------------------------------------------------------------------------------- 1 | Hello World from backend2017-04-17T17:12:14.752Z

Partial

2 | -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-2/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-3/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/javascript/dist/webpack-3/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-3/index.html: -------------------------------------------------------------------------------- 1 | Hello World from backend2017-06-24T21:03:19.943Z

Partial

2 | -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-3/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-4/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/javascript/dist/webpack-4/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-4/index.html: -------------------------------------------------------------------------------- 1 | Hello World from backend2018-02-14T04:00:28.077Z

Partial

2 | -------------------------------------------------------------------------------- /examples/javascript/dist/webpack-4/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/javascript/example.js: -------------------------------------------------------------------------------- 1 | require('./main.css'); 2 | 3 | var universal = require('./universial.js'); 4 | var h1 = document.createElement('h1'); 5 | h1.innerHTML = universal(); 6 | 7 | document.body.appendChild(h1); 8 | -------------------------------------------------------------------------------- /examples/javascript/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/javascript/logo.png -------------------------------------------------------------------------------- /examples/javascript/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/javascript/partial.html: -------------------------------------------------------------------------------- 1 |

Partial

2 | -------------------------------------------------------------------------------- /examples/javascript/readme.md: -------------------------------------------------------------------------------- 1 | # isomorphic javascript example 2 | 3 | This example shows how to generate a template on the fly using javascript. 4 | 5 | The best way to debug the compilation result is `devTool:eval` -------------------------------------------------------------------------------- /examples/javascript/template.js: -------------------------------------------------------------------------------- 1 | // Webpack require: 2 | var partial = require('./partial.html'); 3 | var universal = require('./universial.js'); 4 | 5 | // Export a function / promise / or a string: 6 | module.exports = universal() + new Date().toISOString() + partial; 7 | -------------------------------------------------------------------------------- /examples/javascript/universial.js: -------------------------------------------------------------------------------- 1 | // This file is used for frontend and backend 2 | 'use strict'; 3 | 4 | // If compiled by the html-webpack-plugin 5 | // HTML_WEBPACK_PLUGIN is set to true: 6 | var backend = typeof HTML_WEBPACK_PLUGIN !== 'undefined'; 7 | 8 | module.exports = function () { 9 | return 'Hello World from ' + (backend ? 'backend' : 'frontend'); 10 | }; 11 | -------------------------------------------------------------------------------- /examples/javascript/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var HtmlWebpackPlugin = require('../..'); 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 4 | var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; 5 | module.exports = { 6 | context: __dirname, 7 | entry: './example.js', 8 | output: { 9 | path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion), 10 | publicPath: '', 11 | filename: 'bundle.js' 12 | }, 13 | module: { 14 | loaders: [ 15 | { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }, 16 | { test: /\.png$/, loader: 'file-loader' }, 17 | { test: /\.html$/, loader: 'html-loader' } 18 | ] 19 | }, 20 | devtool: 'eval', 21 | plugins: [ 22 | new HtmlWebpackPlugin({ 23 | template: 'template.js' 24 | }), 25 | new ExtractTextPlugin('styles.css') 26 | ] 27 | }; 28 | -------------------------------------------------------------------------------- /examples/sort-manually/a.js: -------------------------------------------------------------------------------- 1 | require('./main.css'); 2 | var h1 = document.createElement('h1'); 3 | h1.innerHTML = 'a!'; 4 | document.body.appendChild(h1); 5 | -------------------------------------------------------------------------------- /examples/sort-manually/b.js: -------------------------------------------------------------------------------- 1 | var h1 = document.createElement('h1'); 2 | h1.innerHTML = 'b!'; 3 | document.body.appendChild(h1); 4 | -------------------------------------------------------------------------------- /examples/sort-manually/c.js: -------------------------------------------------------------------------------- 1 | var h1 = document.createElement('h1'); 2 | h1.innerHTML = 'c!'; 3 | document.body.appendChild(h1); 4 | -------------------------------------------------------------------------------- /examples/sort-manually/d.js: -------------------------------------------------------------------------------- 1 | var h1 = document.createElement('h1'); 2 | h1.innerHTML = 'd!'; 3 | document.body.appendChild(h1); 4 | -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-1/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/sort-manually/dist/webpack-1/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-1/a.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports, __webpack_require__) { 46 | 47 | __webpack_require__(1); 48 | var h1 = document.createElement('h1'); 49 | h1.innerHTML = 'a!'; 50 | document.body.appendChild(h1); 51 | 52 | 53 | /***/ }), 54 | /* 1 */ 55 | /***/ (function(module, exports) { 56 | 57 | // removed by extract-text-webpack-plugin 58 | 59 | /***/ }) 60 | /******/ ]); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-1/b.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports) { 46 | 47 | var h1 = document.createElement('h1'); 48 | h1.innerHTML = 'b!'; 49 | document.body.appendChild(h1); 50 | 51 | 52 | /***/ }) 53 | /******/ ]); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-1/c.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports) { 46 | 47 | var h1 = document.createElement('h1'); 48 | h1.innerHTML = 'c!'; 49 | document.body.appendChild(h1); 50 | 51 | 52 | /***/ }) 53 | /******/ ]); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-1/d.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports) { 46 | 47 | var h1 = document.createElement('h1'); 48 | h1.innerHTML = 'd!'; 49 | document.body.appendChild(h1); 50 | 51 | 52 | /***/ }) 53 | /******/ ]); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-1/e.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports) { 46 | 47 | var h1 = document.createElement('h1'); 48 | h1.innerHTML = 'e!'; 49 | document.body.appendChild(h1); 50 | 51 | 52 | /***/ }) 53 | /******/ ]); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-1/first-file.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-1/second-file.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-1/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-2/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/sort-manually/dist/webpack-2/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-2/a.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // identity function for calling harmony imports with the correct context 37 | /******/ __webpack_require__.i = function(value) { return value; }; 38 | /******/ 39 | /******/ // define getter function for harmony exports 40 | /******/ __webpack_require__.d = function(exports, name, getter) { 41 | /******/ if(!__webpack_require__.o(exports, name)) { 42 | /******/ Object.defineProperty(exports, name, { 43 | /******/ configurable: false, 44 | /******/ enumerable: true, 45 | /******/ get: getter 46 | /******/ }); 47 | /******/ } 48 | /******/ }; 49 | /******/ 50 | /******/ // getDefaultExport function for compatibility with non-harmony modules 51 | /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = module && module.__esModule ? 53 | /******/ function getDefault() { return module['default']; } : 54 | /******/ function getModuleExports() { return module; }; 55 | /******/ __webpack_require__.d(getter, 'a', getter); 56 | /******/ return getter; 57 | /******/ }; 58 | /******/ 59 | /******/ // Object.prototype.hasOwnProperty.call 60 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61 | /******/ 62 | /******/ // __webpack_public_path__ 63 | /******/ __webpack_require__.p = ""; 64 | /******/ 65 | /******/ // Load entry module and return exports 66 | /******/ return __webpack_require__(__webpack_require__.s = 1); 67 | /******/ }) 68 | /************************************************************************/ 69 | /******/ ([ 70 | /* 0 */ 71 | /***/ (function(module, exports) { 72 | 73 | // removed by extract-text-webpack-plugin 74 | 75 | /***/ }), 76 | /* 1 */ 77 | /***/ (function(module, exports, __webpack_require__) { 78 | 79 | __webpack_require__(0); 80 | var h1 = document.createElement('h1'); 81 | h1.innerHTML = 'a!'; 82 | document.body.appendChild(h1); 83 | 84 | 85 | /***/ }) 86 | /******/ ]); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-2/b.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // identity function for calling harmony imports with the correct context 37 | /******/ __webpack_require__.i = function(value) { return value; }; 38 | /******/ 39 | /******/ // define getter function for harmony exports 40 | /******/ __webpack_require__.d = function(exports, name, getter) { 41 | /******/ if(!__webpack_require__.o(exports, name)) { 42 | /******/ Object.defineProperty(exports, name, { 43 | /******/ configurable: false, 44 | /******/ enumerable: true, 45 | /******/ get: getter 46 | /******/ }); 47 | /******/ } 48 | /******/ }; 49 | /******/ 50 | /******/ // getDefaultExport function for compatibility with non-harmony modules 51 | /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = module && module.__esModule ? 53 | /******/ function getDefault() { return module['default']; } : 54 | /******/ function getModuleExports() { return module; }; 55 | /******/ __webpack_require__.d(getter, 'a', getter); 56 | /******/ return getter; 57 | /******/ }; 58 | /******/ 59 | /******/ // Object.prototype.hasOwnProperty.call 60 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61 | /******/ 62 | /******/ // __webpack_public_path__ 63 | /******/ __webpack_require__.p = ""; 64 | /******/ 65 | /******/ // Load entry module and return exports 66 | /******/ return __webpack_require__(__webpack_require__.s = 2); 67 | /******/ }) 68 | /************************************************************************/ 69 | /******/ ({ 70 | 71 | /***/ 2: 72 | /***/ (function(module, exports) { 73 | 74 | var h1 = document.createElement('h1'); 75 | h1.innerHTML = 'b!'; 76 | document.body.appendChild(h1); 77 | 78 | 79 | /***/ }) 80 | 81 | /******/ }); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-2/c.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // identity function for calling harmony imports with the correct context 37 | /******/ __webpack_require__.i = function(value) { return value; }; 38 | /******/ 39 | /******/ // define getter function for harmony exports 40 | /******/ __webpack_require__.d = function(exports, name, getter) { 41 | /******/ if(!__webpack_require__.o(exports, name)) { 42 | /******/ Object.defineProperty(exports, name, { 43 | /******/ configurable: false, 44 | /******/ enumerable: true, 45 | /******/ get: getter 46 | /******/ }); 47 | /******/ } 48 | /******/ }; 49 | /******/ 50 | /******/ // getDefaultExport function for compatibility with non-harmony modules 51 | /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = module && module.__esModule ? 53 | /******/ function getDefault() { return module['default']; } : 54 | /******/ function getModuleExports() { return module; }; 55 | /******/ __webpack_require__.d(getter, 'a', getter); 56 | /******/ return getter; 57 | /******/ }; 58 | /******/ 59 | /******/ // Object.prototype.hasOwnProperty.call 60 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61 | /******/ 62 | /******/ // __webpack_public_path__ 63 | /******/ __webpack_require__.p = ""; 64 | /******/ 65 | /******/ // Load entry module and return exports 66 | /******/ return __webpack_require__(__webpack_require__.s = 3); 67 | /******/ }) 68 | /************************************************************************/ 69 | /******/ ({ 70 | 71 | /***/ 3: 72 | /***/ (function(module, exports) { 73 | 74 | var h1 = document.createElement('h1'); 75 | h1.innerHTML = 'c!'; 76 | document.body.appendChild(h1); 77 | 78 | 79 | /***/ }) 80 | 81 | /******/ }); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-2/d.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // identity function for calling harmony imports with the correct context 37 | /******/ __webpack_require__.i = function(value) { return value; }; 38 | /******/ 39 | /******/ // define getter function for harmony exports 40 | /******/ __webpack_require__.d = function(exports, name, getter) { 41 | /******/ if(!__webpack_require__.o(exports, name)) { 42 | /******/ Object.defineProperty(exports, name, { 43 | /******/ configurable: false, 44 | /******/ enumerable: true, 45 | /******/ get: getter 46 | /******/ }); 47 | /******/ } 48 | /******/ }; 49 | /******/ 50 | /******/ // getDefaultExport function for compatibility with non-harmony modules 51 | /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = module && module.__esModule ? 53 | /******/ function getDefault() { return module['default']; } : 54 | /******/ function getModuleExports() { return module; }; 55 | /******/ __webpack_require__.d(getter, 'a', getter); 56 | /******/ return getter; 57 | /******/ }; 58 | /******/ 59 | /******/ // Object.prototype.hasOwnProperty.call 60 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61 | /******/ 62 | /******/ // __webpack_public_path__ 63 | /******/ __webpack_require__.p = ""; 64 | /******/ 65 | /******/ // Load entry module and return exports 66 | /******/ return __webpack_require__(__webpack_require__.s = 4); 67 | /******/ }) 68 | /************************************************************************/ 69 | /******/ ({ 70 | 71 | /***/ 4: 72 | /***/ (function(module, exports) { 73 | 74 | var h1 = document.createElement('h1'); 75 | h1.innerHTML = 'd!'; 76 | document.body.appendChild(h1); 77 | 78 | 79 | /***/ }) 80 | 81 | /******/ }); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-2/e.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // identity function for calling harmony imports with the correct context 37 | /******/ __webpack_require__.i = function(value) { return value; }; 38 | /******/ 39 | /******/ // define getter function for harmony exports 40 | /******/ __webpack_require__.d = function(exports, name, getter) { 41 | /******/ if(!__webpack_require__.o(exports, name)) { 42 | /******/ Object.defineProperty(exports, name, { 43 | /******/ configurable: false, 44 | /******/ enumerable: true, 45 | /******/ get: getter 46 | /******/ }); 47 | /******/ } 48 | /******/ }; 49 | /******/ 50 | /******/ // getDefaultExport function for compatibility with non-harmony modules 51 | /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = module && module.__esModule ? 53 | /******/ function getDefault() { return module['default']; } : 54 | /******/ function getModuleExports() { return module; }; 55 | /******/ __webpack_require__.d(getter, 'a', getter); 56 | /******/ return getter; 57 | /******/ }; 58 | /******/ 59 | /******/ // Object.prototype.hasOwnProperty.call 60 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61 | /******/ 62 | /******/ // __webpack_public_path__ 63 | /******/ __webpack_require__.p = ""; 64 | /******/ 65 | /******/ // Load entry module and return exports 66 | /******/ return __webpack_require__(__webpack_require__.s = 5); 67 | /******/ }) 68 | /************************************************************************/ 69 | /******/ ({ 70 | 71 | /***/ 5: 72 | /***/ (function(module, exports) { 73 | 74 | var h1 = document.createElement('h1'); 75 | h1.innerHTML = 'e!'; 76 | document.body.appendChild(h1); 77 | 78 | 79 | /***/ }) 80 | 81 | /******/ }); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-2/first-file.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-2/second-file.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-2/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-3/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/sort-manually/dist/webpack-3/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-3/a.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // getDefaultExport function for compatibility with non-harmony modules 48 | /******/ __webpack_require__.n = function(module) { 49 | /******/ var getter = module && module.__esModule ? 50 | /******/ function getDefault() { return module['default']; } : 51 | /******/ function getModuleExports() { return module; }; 52 | /******/ __webpack_require__.d(getter, 'a', getter); 53 | /******/ return getter; 54 | /******/ }; 55 | /******/ 56 | /******/ // Object.prototype.hasOwnProperty.call 57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58 | /******/ 59 | /******/ // __webpack_public_path__ 60 | /******/ __webpack_require__.p = ""; 61 | /******/ 62 | /******/ // Load entry module and return exports 63 | /******/ return __webpack_require__(__webpack_require__.s = 2); 64 | /******/ }) 65 | /************************************************************************/ 66 | /******/ ([ 67 | /* 0 */, 68 | /* 1 */, 69 | /* 2 */ 70 | /***/ (function(module, exports, __webpack_require__) { 71 | 72 | __webpack_require__(3); 73 | var h1 = document.createElement('h1'); 74 | h1.innerHTML = 'a!'; 75 | document.body.appendChild(h1); 76 | 77 | 78 | /***/ }), 79 | /* 3 */ 80 | /***/ (function(module, exports) { 81 | 82 | // removed by extract-text-webpack-plugin 83 | 84 | /***/ }) 85 | /******/ ]); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-3/b.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // getDefaultExport function for compatibility with non-harmony modules 48 | /******/ __webpack_require__.n = function(module) { 49 | /******/ var getter = module && module.__esModule ? 50 | /******/ function getDefault() { return module['default']; } : 51 | /******/ function getModuleExports() { return module; }; 52 | /******/ __webpack_require__.d(getter, 'a', getter); 53 | /******/ return getter; 54 | /******/ }; 55 | /******/ 56 | /******/ // Object.prototype.hasOwnProperty.call 57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58 | /******/ 59 | /******/ // __webpack_public_path__ 60 | /******/ __webpack_require__.p = ""; 61 | /******/ 62 | /******/ // Load entry module and return exports 63 | /******/ return __webpack_require__(__webpack_require__.s = 0); 64 | /******/ }) 65 | /************************************************************************/ 66 | /******/ ([ 67 | /* 0 */ 68 | /***/ (function(module, exports) { 69 | 70 | var h1 = document.createElement('h1'); 71 | h1.innerHTML = 'b!'; 72 | document.body.appendChild(h1); 73 | 74 | 75 | /***/ }) 76 | /******/ ]); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-3/c.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // getDefaultExport function for compatibility with non-harmony modules 48 | /******/ __webpack_require__.n = function(module) { 49 | /******/ var getter = module && module.__esModule ? 50 | /******/ function getDefault() { return module['default']; } : 51 | /******/ function getModuleExports() { return module; }; 52 | /******/ __webpack_require__.d(getter, 'a', getter); 53 | /******/ return getter; 54 | /******/ }; 55 | /******/ 56 | /******/ // Object.prototype.hasOwnProperty.call 57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58 | /******/ 59 | /******/ // __webpack_public_path__ 60 | /******/ __webpack_require__.p = ""; 61 | /******/ 62 | /******/ // Load entry module and return exports 63 | /******/ return __webpack_require__(__webpack_require__.s = 4); 64 | /******/ }) 65 | /************************************************************************/ 66 | /******/ ({ 67 | 68 | /***/ 4: 69 | /***/ (function(module, exports) { 70 | 71 | var h1 = document.createElement('h1'); 72 | h1.innerHTML = 'c!'; 73 | document.body.appendChild(h1); 74 | 75 | 76 | /***/ }) 77 | 78 | /******/ }); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-3/d.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // getDefaultExport function for compatibility with non-harmony modules 48 | /******/ __webpack_require__.n = function(module) { 49 | /******/ var getter = module && module.__esModule ? 50 | /******/ function getDefault() { return module['default']; } : 51 | /******/ function getModuleExports() { return module; }; 52 | /******/ __webpack_require__.d(getter, 'a', getter); 53 | /******/ return getter; 54 | /******/ }; 55 | /******/ 56 | /******/ // Object.prototype.hasOwnProperty.call 57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58 | /******/ 59 | /******/ // __webpack_public_path__ 60 | /******/ __webpack_require__.p = ""; 61 | /******/ 62 | /******/ // Load entry module and return exports 63 | /******/ return __webpack_require__(__webpack_require__.s = 1); 64 | /******/ }) 65 | /************************************************************************/ 66 | /******/ ([ 67 | /* 0 */, 68 | /* 1 */ 69 | /***/ (function(module, exports) { 70 | 71 | var h1 = document.createElement('h1'); 72 | h1.innerHTML = 'd!'; 73 | document.body.appendChild(h1); 74 | 75 | 76 | /***/ }) 77 | /******/ ]); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-3/e.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // getDefaultExport function for compatibility with non-harmony modules 48 | /******/ __webpack_require__.n = function(module) { 49 | /******/ var getter = module && module.__esModule ? 50 | /******/ function getDefault() { return module['default']; } : 51 | /******/ function getModuleExports() { return module; }; 52 | /******/ __webpack_require__.d(getter, 'a', getter); 53 | /******/ return getter; 54 | /******/ }; 55 | /******/ 56 | /******/ // Object.prototype.hasOwnProperty.call 57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58 | /******/ 59 | /******/ // __webpack_public_path__ 60 | /******/ __webpack_require__.p = ""; 61 | /******/ 62 | /******/ // Load entry module and return exports 63 | /******/ return __webpack_require__(__webpack_require__.s = 5); 64 | /******/ }) 65 | /************************************************************************/ 66 | /******/ ({ 67 | 68 | /***/ 5: 69 | /***/ (function(module, exports) { 70 | 71 | var h1 = document.createElement('h1'); 72 | h1.innerHTML = 'e!'; 73 | document.body.appendChild(h1); 74 | 75 | 76 | /***/ }) 77 | 78 | /******/ }); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-3/first-file.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-3/second-file.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-3/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-4/0714810ae3fb211173e2964249507195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/sort-manually/dist/webpack-4/0714810ae3fb211173e2964249507195.png -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-4/a.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // define __esModule on exports 48 | /******/ __webpack_require__.r = function(exports) { 49 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 50 | /******/ }; 51 | /******/ 52 | /******/ // getDefaultExport function for compatibility with non-harmony modules 53 | /******/ __webpack_require__.n = function(module) { 54 | /******/ var getter = module && module.__esModule ? 55 | /******/ function getDefault() { return module['default']; } : 56 | /******/ function getModuleExports() { return module; }; 57 | /******/ __webpack_require__.d(getter, 'a', getter); 58 | /******/ return getter; 59 | /******/ }; 60 | /******/ 61 | /******/ // Object.prototype.hasOwnProperty.call 62 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 63 | /******/ 64 | /******/ // __webpack_public_path__ 65 | /******/ __webpack_require__.p = ""; 66 | /******/ 67 | /******/ 68 | /******/ // Load entry module and return exports 69 | /******/ return __webpack_require__(__webpack_require__.s = 2); 70 | /******/ }) 71 | /************************************************************************/ 72 | /******/ ({ 73 | 74 | /***/ 2: 75 | /***/ (function(module, exports, __webpack_require__) { 76 | 77 | __webpack_require__(8); 78 | var h1 = document.createElement('h1'); 79 | h1.innerHTML = 'a!'; 80 | document.body.appendChild(h1); 81 | 82 | 83 | /***/ }), 84 | 85 | /***/ 8: 86 | /***/ (function(module, exports) { 87 | 88 | // removed by extract-text-webpack-plugin 89 | 90 | /***/ }) 91 | 92 | /******/ }); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-4/b.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // define __esModule on exports 48 | /******/ __webpack_require__.r = function(exports) { 49 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 50 | /******/ }; 51 | /******/ 52 | /******/ // getDefaultExport function for compatibility with non-harmony modules 53 | /******/ __webpack_require__.n = function(module) { 54 | /******/ var getter = module && module.__esModule ? 55 | /******/ function getDefault() { return module['default']; } : 56 | /******/ function getModuleExports() { return module; }; 57 | /******/ __webpack_require__.d(getter, 'a', getter); 58 | /******/ return getter; 59 | /******/ }; 60 | /******/ 61 | /******/ // Object.prototype.hasOwnProperty.call 62 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 63 | /******/ 64 | /******/ // __webpack_public_path__ 65 | /******/ __webpack_require__.p = ""; 66 | /******/ 67 | /******/ 68 | /******/ // Load entry module and return exports 69 | /******/ return __webpack_require__(__webpack_require__.s = 4); 70 | /******/ }) 71 | /************************************************************************/ 72 | /******/ ({ 73 | 74 | /***/ 4: 75 | /***/ (function(module, exports) { 76 | 77 | var h1 = document.createElement('h1'); 78 | h1.innerHTML = 'b!'; 79 | document.body.appendChild(h1); 80 | 81 | 82 | /***/ }) 83 | 84 | /******/ }); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-4/c.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // define __esModule on exports 48 | /******/ __webpack_require__.r = function(exports) { 49 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 50 | /******/ }; 51 | /******/ 52 | /******/ // getDefaultExport function for compatibility with non-harmony modules 53 | /******/ __webpack_require__.n = function(module) { 54 | /******/ var getter = module && module.__esModule ? 55 | /******/ function getDefault() { return module['default']; } : 56 | /******/ function getModuleExports() { return module; }; 57 | /******/ __webpack_require__.d(getter, 'a', getter); 58 | /******/ return getter; 59 | /******/ }; 60 | /******/ 61 | /******/ // Object.prototype.hasOwnProperty.call 62 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 63 | /******/ 64 | /******/ // __webpack_public_path__ 65 | /******/ __webpack_require__.p = ""; 66 | /******/ 67 | /******/ 68 | /******/ // Load entry module and return exports 69 | /******/ return __webpack_require__(__webpack_require__.s = 1); 70 | /******/ }) 71 | /************************************************************************/ 72 | /******/ ([ 73 | /* 0 */, 74 | /* 1 */ 75 | /***/ (function(module, exports) { 76 | 77 | var h1 = document.createElement('h1'); 78 | h1.innerHTML = 'c!'; 79 | document.body.appendChild(h1); 80 | 81 | 82 | /***/ }) 83 | /******/ ]); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-4/d.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // define __esModule on exports 48 | /******/ __webpack_require__.r = function(exports) { 49 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 50 | /******/ }; 51 | /******/ 52 | /******/ // getDefaultExport function for compatibility with non-harmony modules 53 | /******/ __webpack_require__.n = function(module) { 54 | /******/ var getter = module && module.__esModule ? 55 | /******/ function getDefault() { return module['default']; } : 56 | /******/ function getModuleExports() { return module; }; 57 | /******/ __webpack_require__.d(getter, 'a', getter); 58 | /******/ return getter; 59 | /******/ }; 60 | /******/ 61 | /******/ // Object.prototype.hasOwnProperty.call 62 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 63 | /******/ 64 | /******/ // __webpack_public_path__ 65 | /******/ __webpack_require__.p = ""; 66 | /******/ 67 | /******/ 68 | /******/ // Load entry module and return exports 69 | /******/ return __webpack_require__(__webpack_require__.s = 3); 70 | /******/ }) 71 | /************************************************************************/ 72 | /******/ ({ 73 | 74 | /***/ 3: 75 | /***/ (function(module, exports) { 76 | 77 | var h1 = document.createElement('h1'); 78 | h1.innerHTML = 'd!'; 79 | document.body.appendChild(h1); 80 | 81 | 82 | /***/ }) 83 | 84 | /******/ }); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-4/e.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // define __esModule on exports 48 | /******/ __webpack_require__.r = function(exports) { 49 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 50 | /******/ }; 51 | /******/ 52 | /******/ // getDefaultExport function for compatibility with non-harmony modules 53 | /******/ __webpack_require__.n = function(module) { 54 | /******/ var getter = module && module.__esModule ? 55 | /******/ function getDefault() { return module['default']; } : 56 | /******/ function getModuleExports() { return module; }; 57 | /******/ __webpack_require__.d(getter, 'a', getter); 58 | /******/ return getter; 59 | /******/ }; 60 | /******/ 61 | /******/ // Object.prototype.hasOwnProperty.call 62 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 63 | /******/ 64 | /******/ // __webpack_public_path__ 65 | /******/ __webpack_require__.p = ""; 66 | /******/ 67 | /******/ 68 | /******/ // Load entry module and return exports 69 | /******/ return __webpack_require__(__webpack_require__.s = 0); 70 | /******/ }) 71 | /************************************************************************/ 72 | /******/ ([ 73 | /* 0 */ 74 | /***/ (function(module, exports) { 75 | 76 | var h1 = document.createElement('h1'); 77 | h1.innerHTML = 'e!'; 78 | document.body.appendChild(h1); 79 | 80 | 81 | /***/ }) 82 | /******/ ]); -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-4/first-file.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-4/second-file.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/sort-manually/dist/webpack-4/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/sort-manually/e.js: -------------------------------------------------------------------------------- 1 | var h1 = document.createElement('h1'); 2 | h1.innerHTML = 'e!'; 3 | document.body.appendChild(h1); 4 | -------------------------------------------------------------------------------- /examples/sort-manually/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/examples/sort-manually/logo.png -------------------------------------------------------------------------------- /examples/sort-manually/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /examples/sort-manually/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example template 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/sort-manually/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var HtmlWebpackPlugin = require('../..'); 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 4 | var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; 5 | module.exports = { 6 | context: __dirname, 7 | entry: { 8 | b: './b.js', 9 | d: './d.js', 10 | a: './a.js', 11 | c: './c.js', 12 | e: './e.js' 13 | }, 14 | output: { 15 | path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion), 16 | publicPath: '', 17 | filename: '[name].js' 18 | }, 19 | module: { 20 | loaders: [ 21 | { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }, 22 | { test: /\.png$/, loader: 'file-loader' }, 23 | { test: /\.html$/, loader: 'html-loader' } 24 | ] 25 | }, 26 | plugins: [ 27 | new HtmlWebpackPlugin({ 28 | inject: true, 29 | filename: 'first-file.html', 30 | template: 'template.html', 31 | chunksSortMode: 'manual', 32 | chunks: ['a', 'b', 'c'] 33 | }), 34 | new HtmlWebpackPlugin({ 35 | inject: true, 36 | filename: 'second-file.html', 37 | template: 'template.html', 38 | chunksSortMode: 'manual', 39 | chunks: ['a', 'b', 'd'] 40 | }), 41 | new ExtractTextPlugin('styles.css') 42 | ] 43 | }; 44 | -------------------------------------------------------------------------------- /examples/template-parameters/dist/webpack-1/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) 10 | /******/ return installedModules[moduleId].exports; 11 | 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ exports: {}, 15 | /******/ id: moduleId, 16 | /******/ loaded: false 17 | /******/ }; 18 | 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | 22 | /******/ // Flag the module as loaded 23 | /******/ module.loaded = true; 24 | 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | 29 | 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | 36 | /******/ // __webpack_public_path__ 37 | /******/ __webpack_require__.p = ""; 38 | 39 | /******/ // Load entry module and return exports 40 | /******/ return __webpack_require__(0); 41 | /******/ }) 42 | /************************************************************************/ 43 | /******/ ([ 44 | /* 0 */ 45 | /***/ (function(module, exports) { 46 | 47 | var h1 = document.createElement('h1'); 48 | h1.innerHTML = 'Hello world!'; 49 | document.body.appendChild(h1); 50 | 51 | 52 | /***/ }) 53 | /******/ ]); -------------------------------------------------------------------------------- /examples/template-parameters/dist/webpack-1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bar 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/template-parameters/dist/webpack-2/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // identity function for calling harmony imports with the correct context 37 | /******/ __webpack_require__.i = function(value) { return value; }; 38 | /******/ 39 | /******/ // define getter function for harmony exports 40 | /******/ __webpack_require__.d = function(exports, name, getter) { 41 | /******/ if(!__webpack_require__.o(exports, name)) { 42 | /******/ Object.defineProperty(exports, name, { 43 | /******/ configurable: false, 44 | /******/ enumerable: true, 45 | /******/ get: getter 46 | /******/ }); 47 | /******/ } 48 | /******/ }; 49 | /******/ 50 | /******/ // getDefaultExport function for compatibility with non-harmony modules 51 | /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = module && module.__esModule ? 53 | /******/ function getDefault() { return module['default']; } : 54 | /******/ function getModuleExports() { return module; }; 55 | /******/ __webpack_require__.d(getter, 'a', getter); 56 | /******/ return getter; 57 | /******/ }; 58 | /******/ 59 | /******/ // Object.prototype.hasOwnProperty.call 60 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61 | /******/ 62 | /******/ // __webpack_public_path__ 63 | /******/ __webpack_require__.p = ""; 64 | /******/ 65 | /******/ // Load entry module and return exports 66 | /******/ return __webpack_require__(__webpack_require__.s = 0); 67 | /******/ }) 68 | /************************************************************************/ 69 | /******/ ([ 70 | /* 0 */ 71 | /***/ (function(module, exports) { 72 | 73 | var h1 = document.createElement('h1'); 74 | h1.innerHTML = 'Hello world!'; 75 | document.body.appendChild(h1); 76 | 77 | 78 | /***/ }) 79 | /******/ ]); -------------------------------------------------------------------------------- /examples/template-parameters/dist/webpack-2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bar 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/template-parameters/dist/webpack-3/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // getDefaultExport function for compatibility with non-harmony modules 48 | /******/ __webpack_require__.n = function(module) { 49 | /******/ var getter = module && module.__esModule ? 50 | /******/ function getDefault() { return module['default']; } : 51 | /******/ function getModuleExports() { return module; }; 52 | /******/ __webpack_require__.d(getter, 'a', getter); 53 | /******/ return getter; 54 | /******/ }; 55 | /******/ 56 | /******/ // Object.prototype.hasOwnProperty.call 57 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58 | /******/ 59 | /******/ // __webpack_public_path__ 60 | /******/ __webpack_require__.p = ""; 61 | /******/ 62 | /******/ // Load entry module and return exports 63 | /******/ return __webpack_require__(__webpack_require__.s = 0); 64 | /******/ }) 65 | /************************************************************************/ 66 | /******/ ([ 67 | /* 0 */ 68 | /***/ (function(module, exports) { 69 | 70 | var h1 = document.createElement('h1'); 71 | h1.innerHTML = 'Hello world!'; 72 | document.body.appendChild(h1); 73 | 74 | 75 | /***/ }) 76 | /******/ ]); -------------------------------------------------------------------------------- /examples/template-parameters/dist/webpack-3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bar 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/template-parameters/dist/webpack-4/bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { 40 | /******/ configurable: false, 41 | /******/ enumerable: true, 42 | /******/ get: getter 43 | /******/ }); 44 | /******/ } 45 | /******/ }; 46 | /******/ 47 | /******/ // define __esModule on exports 48 | /******/ __webpack_require__.r = function(exports) { 49 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 50 | /******/ }; 51 | /******/ 52 | /******/ // getDefaultExport function for compatibility with non-harmony modules 53 | /******/ __webpack_require__.n = function(module) { 54 | /******/ var getter = module && module.__esModule ? 55 | /******/ function getDefault() { return module['default']; } : 56 | /******/ function getModuleExports() { return module; }; 57 | /******/ __webpack_require__.d(getter, 'a', getter); 58 | /******/ return getter; 59 | /******/ }; 60 | /******/ 61 | /******/ // Object.prototype.hasOwnProperty.call 62 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 63 | /******/ 64 | /******/ // __webpack_public_path__ 65 | /******/ __webpack_require__.p = ""; 66 | /******/ 67 | /******/ 68 | /******/ // Load entry module and return exports 69 | /******/ return __webpack_require__(__webpack_require__.s = 0); 70 | /******/ }) 71 | /************************************************************************/ 72 | /******/ ([ 73 | /* 0 */ 74 | /***/ (function(module, exports) { 75 | 76 | var h1 = document.createElement('h1'); 77 | h1.innerHTML = 'Hello world!'; 78 | document.body.appendChild(h1); 79 | 80 | 81 | /***/ }) 82 | /******/ ]); -------------------------------------------------------------------------------- /examples/template-parameters/dist/webpack-4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bar 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/template-parameters/example.js: -------------------------------------------------------------------------------- 1 | var h1 = document.createElement('h1'); 2 | h1.innerHTML = 'Hello world!'; 3 | document.body.appendChild(h1); 4 | -------------------------------------------------------------------------------- /examples/template-parameters/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%= foo %> 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/template-parameters/readme.md: -------------------------------------------------------------------------------- 1 | # template parameters example 2 | 3 | This example shows how you can overwrite the built in template parameters 4 | -------------------------------------------------------------------------------- /examples/template-parameters/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var HtmlWebpackPlugin = require('../..'); 3 | var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; 4 | module.exports = { 5 | context: __dirname, 6 | entry: './example.js', 7 | output: { 8 | path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion), 9 | publicPath: '', 10 | filename: 'bundle.js' 11 | }, 12 | plugins: [ 13 | new HtmlWebpackPlugin({ 14 | templateParameters: { 15 | 'foo': 'bar' 16 | }, 17 | template: 'index.ejs' 18 | }) 19 | ] 20 | }; 21 | -------------------------------------------------------------------------------- /lib/errors.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const PrettyError = require('pretty-error'); 3 | const prettyError = new PrettyError(); 4 | prettyError.withoutColors(); 5 | prettyError.skipPackage(['html-plugin-evaluation']); 6 | prettyError.skipNodeFiles(); 7 | prettyError.skip(function (traceLine) { 8 | return traceLine.path === 'html-plugin-evaluation'; 9 | }); 10 | 11 | module.exports = function (err, context) { 12 | return { 13 | toHtml: function () { 14 | return 'Html Webpack Plugin:\n
\n' + this.toString() + '
'; 15 | }, 16 | toJsonHtml: function () { 17 | return JSON.stringify(this.toHtml()); 18 | }, 19 | toString: function () { 20 | return prettyError.render(err).replace(/webpack:\/\/\/\./g, context); 21 | } 22 | }; 23 | }; 24 | -------------------------------------------------------------------------------- /lib/loader.js: -------------------------------------------------------------------------------- 1 | /* This loader renders the template with underscore if no other loader was found */ 2 | 'use strict'; 3 | 4 | const _ = require('lodash'); 5 | const loaderUtils = require('loader-utils'); 6 | 7 | module.exports = function (source) { 8 | if (this.cacheable) { 9 | this.cacheable(); 10 | } 11 | const allLoadersButThisOne = this.loaders.filter(function (loader) { 12 | // Loader API changed from `loader.module` to `loader.normal` in Webpack 2. 13 | return (loader.module || loader.normal) !== module.exports; 14 | }); 15 | // This loader shouldn't kick in if there is any other loader 16 | if (allLoadersButThisOne.length > 0) { 17 | return source; 18 | } 19 | // Skip .js files 20 | if (/\.js$/.test(this.resourcePath)) { 21 | return source; 22 | } 23 | 24 | // The following part renders the tempalte with lodash as aminimalistic loader 25 | // 26 | // Get templating options 27 | const options = this.query !== '' ? loaderUtils.parseQuery(this.query) : {}; 28 | const template = _.template(source, _.defaults(options, { variable: 'data' })); 29 | // Require !!lodash - using !! will disable all loaders (e.g. babel) 30 | return 'var _ = require(' + loaderUtils.stringifyRequest(this, '!!' + require.resolve('lodash')) + ');' + 31 | 'module.exports = function (templateParams) { with(templateParams) {' + 32 | // Execute the lodash template 33 | 'return (' + template.source + ')();' + 34 | '}}'; 35 | }; 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vuepress-html-webpack-plugin", 3 | "version": "3.2.0", 4 | "license": "MIT", 5 | "description": "Simplifies creation of HTML files to serve your webpack bundles", 6 | "author": "Charles Blaxland (https://github.com/ampedandwired)", 7 | "main": "index.js", 8 | "files": [ 9 | "lib/", 10 | "index.js", 11 | "default_index.ejs" 12 | ], 13 | "scripts": { 14 | "pretest": "semistandard", 15 | "commit": "git-cz", 16 | "build-examples": "node examples/build-examples.js", 17 | "test": "jasmine", 18 | "release": "standard-version" 19 | }, 20 | "semistandard": { 21 | "ignore": [ 22 | "examples/*/dist/**/*.*" 23 | ] 24 | }, 25 | "devDependencies": { 26 | "appcache-webpack-plugin": "^1.3.0", 27 | "commitizen": "2.9.6", 28 | "css-loader": "^0.26.1", 29 | "cz-conventional-changelog": "2.1.0", 30 | "dir-compare": "1.3.0", 31 | "es6-promise": "^4.0.5", 32 | "extract-text-webpack-plugin": "^1.0.1", 33 | "file-loader": "^0.9.0", 34 | "html-loader": "^0.4.4", 35 | "jade": "^1.11.0", 36 | "jade-loader": "^0.8.0", 37 | "jasmine": "^2.5.2", 38 | "jasmine-diff-matchers": "^2.0.0", 39 | "rimraf": "^2.5.4", 40 | "semistandard": "8.0.0", 41 | "standard-version": "^4.3.0", 42 | "style-loader": "^0.13.1", 43 | "underscore-template-loader": "^0.7.3", 44 | "url-loader": "^0.5.7", 45 | "webpack": "^1.14.0", 46 | "webpack-recompilation-simulator": "^1.3.0" 47 | }, 48 | "dependencies": { 49 | "html-minifier": "^3.2.3", 50 | "loader-utils": "^0.2.16", 51 | "lodash": "^4.17.3", 52 | "pretty-error": "^2.0.2", 53 | "tapable": "^1.0.0", 54 | "toposort": "^1.0.0", 55 | "util.promisify": "1.0.0" 56 | }, 57 | "peerDependencies": { 58 | "webpack": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" 59 | }, 60 | "keywords": [ 61 | "webpack", 62 | "plugin", 63 | "html", 64 | "html-webpack-plugin" 65 | ], 66 | "bugs": "https://github.com/jantimon/html-webpack-plugin/issues", 67 | "homepage": "https://github.com/jantimon/html-webpack-plugin", 68 | "repository": "https://github.com/jantimon/html-webpack-plugin.git", 69 | "engines": { 70 | "node": ">=6.9" 71 | }, 72 | "config": { 73 | "commitizen": { 74 | "path": "./node_modules/cz-conventional-changelog" 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /spec/fixtures/async.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = 'async'; 3 | -------------------------------------------------------------------------------- /spec/fixtures/common.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = 'common'; 4 | -------------------------------------------------------------------------------- /spec/fixtures/empty_html.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/spec/fixtures/empty_html.html -------------------------------------------------------------------------------- /spec/fixtures/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yyx990803/html-webpack-plugin/e855da65f542387141e6e64d10e708062acd452a/spec/fixtures/favicon.ico -------------------------------------------------------------------------------- /spec/fixtures/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./common'); 4 | 5 | require.ensure([], function () { 6 | require('./async'); 7 | }); 8 | 9 | document.body.innerHTML = document.body.innerHTML + '

index.js

'; 10 | -------------------------------------------------------------------------------- /spec/fixtures/invalid.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Test 6 | 7 | 8 |

Some unique text

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spec/fixtures/legacy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Test 6 | 7 | 8 |

Some unique text

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spec/fixtures/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: snow; 3 | } -------------------------------------------------------------------------------- /spec/fixtures/plain.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example Plain file 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spec/fixtures/spaced_plain.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /spec/fixtures/template.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | meta(http-equiv="Content-type" content="text/html; charset=utf-8") 5 | title Demo 6 | body 7 | p Some unique text 8 | each jsFile in htmlWebpackPlugin.files.js 9 | script(type="text/javascript" src!=jsFile) 10 | -------------------------------------------------------------------------------- /spec/fixtures/templateParam.js: -------------------------------------------------------------------------------- 1 | module.exports = function (templateParams) { 2 | return 'templateParams keys: "' + Object.keys(templateParams).join(',') + '"'; 3 | }; 4 | -------------------------------------------------------------------------------- /spec/fixtures/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Test 6 | 7 | 8 |

Some unique text

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spec/fixtures/theme.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./main.css'); 4 | require('./index.js'); 5 | -------------------------------------------------------------------------------- /spec/fixtures/util.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./common'); 4 | document.body.innerHTML = document.body.innerHTML + '

util.js

'; 5 | -------------------------------------------------------------------------------- /spec/fixtures/webpackconfig.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Test 6 | 7 | 8 |

Public path is <%= webpackConfig.output.publicPath %>

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "stopSpecOnExpectationFailure": false, 7 | "random": true 8 | } 9 | --------------------------------------------------------------------------------