diff options
| author | ruki <waruqi@gmail.com> | 2018-11-08 00:38:48 +0800 |
|---|---|---|
| committer | ruki <waruqi@gmail.com> | 2018-11-07 21:53:09 +0800 |
| commit | 26105034da4fcce7ac883c899d781f016559310d (patch) | |
| tree | c459a5dc4e3aa0972d9919033ece511ce76dd129 /node_modules/vuepress-html-webpack-plugin | |
| parent | 2c77f00f1a7ecb6c8192f9c16d3b2001b254a107 (diff) | |
| download | xmake-docs-26105034da4fcce7ac883c899d781f016559310d.tar.gz xmake-docs-26105034da4fcce7ac883c899d781f016559310d.zip | |
switch to vuepress
Diffstat (limited to 'node_modules/vuepress-html-webpack-plugin')
17 files changed, 2632 insertions, 0 deletions
diff --git a/node_modules/vuepress-html-webpack-plugin/CHANGELOG.md b/node_modules/vuepress-html-webpack-plugin/CHANGELOG.md new file mode 100644 index 00000000..48108ea1 --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/CHANGELOG.md @@ -0,0 +1,452 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +<a name="3.2.0"></a> +# [3.2.0](https://github.com/jantimon/html-webpack-plugin/compare/v3.1.0...v3.2.0) (2018-04-03) + + +### Bug Fixes + +* **loader:** Allow to add new template parameters ([f7eac19](https://github.com/jantimon/html-webpack-plugin/commit/f7eac19)), closes [#915](https://github.com/jantimon/html-webpack-plugin/issues/915) +* **loader:** Use lodash inside the loader directly ([7b4eb7f](https://github.com/jantimon/html-webpack-plugin/commit/7b4eb7f)), closes [#786](https://github.com/jantimon/html-webpack-plugin/issues/786) + + +### Features + +* Add meta tag option ([a7d37ca](https://github.com/jantimon/html-webpack-plugin/commit/a7d37ca)) +* Support node 6.9 ([74a22c4](https://github.com/jantimon/html-webpack-plugin/commit/74a22c4)), closes [#918](https://github.com/jantimon/html-webpack-plugin/issues/918) + + + +<a name="3.1.0"></a> +# [3.1.0](https://github.com/jantimon/html-webpack-plugin/compare/v3.0.8...v3.1.0) (2018-03-22) + + +### Features + +* Allow to overwrite the templateParameter [#830](https://github.com/jantimon/html-webpack-plugin/issues/830) ([c5e32d3](https://github.com/jantimon/html-webpack-plugin/commit/c5e32d3)) + + + +<a name="3.0.8"></a> +## [3.0.8](https://github.com/jantimon/html-webpack-plugin/compare/v3.0.7...v3.0.8) (2018-03-22) + + +### Bug Fixes + +* **compiler:** Fallback to 3.0.7 because of [#900](https://github.com/jantimon/html-webpack-plugin/issues/900) ([05ee29b](https://github.com/jantimon/html-webpack-plugin/commit/05ee29b)) + + + +<a name="3.0.7"></a> +## [3.0.7](https://github.com/jantimon/html-webpack-plugin/compare/v3.0.6...v3.0.7) (2018-03-19) + + +### Bug Fixes + +* **compiler:** Set single entry name [#895](https://github.com/jantimon/html-webpack-plugin/issues/895) ([26dcb98](https://github.com/jantimon/html-webpack-plugin/commit/26dcb98)) + + + +<a name="3.0.6"></a> +## [3.0.6](https://github.com/jantimon/html-webpack-plugin/compare/v3.0.5...v3.0.6) (2018-03-06) + + +### Bug Fixes + +* **hooks:** Call tapable.apply directly [#879](https://github.com/jantimon/html-webpack-plugin/issues/879) ([bcbb036](https://github.com/jantimon/html-webpack-plugin/commit/bcbb036)) + + + +<a name="3.0.5"></a> +## [3.0.5](https://github.com/jantimon/html-webpack-plugin/compare/v3.0.2...v3.0.5) (2018-03-06) + + +### Bug Fixes + +* **entries:** do not ignore JS if there is also CSS ([020b714](https://github.com/jantimon/html-webpack-plugin/commit/020b714)) +* **entries:** Don't add css entries twice ([0348d6b](https://github.com/jantimon/html-webpack-plugin/commit/0348d6b)) +* **hooks:** Remove deprecated tapable calls [#879](https://github.com/jantimon/html-webpack-plugin/issues/879) ([2288f20](https://github.com/jantimon/html-webpack-plugin/commit/2288f20)) + + + +<a name="3.0.4"></a> +## [3.0.4](https://github.com/jantimon/html-webpack-plugin/compare/v3.0.2...v3.0.4) (2018-03-01) + + +### Bug Fixes + +* **entries:** Don't add css entries twice ([e890f23](https://github.com/jantimon/html-webpack-plugin/commit/e890f23)) + + + +<a name="3.0.3"></a> +## [3.0.3](https://github.com/jantimon/html-webpack-plugin/compare/v3.0.2...v3.0.3) (2018-03-01) + + +### Refactor + +* **performance:** Reduce the amount of chunk information gathered based on #825 ([06c59a7](https://github.com/jantimon/html-webpack-plugin/commit/06c59a7)) + + +<a name="3.0.2"></a> +## [3.0.2](https://github.com/jantimon/html-webpack-plugin/compare/v3.0.1...v3.0.2) (2018-03-01) + + +### Bug Fixes + +* **query-loader:** In case no query is provided, return an empty object. This fixes #727 ([7587754](https://github.com/jantimon/html-webpack-plugin/commit/7587754)) + + + +<a name="3.0.1"></a> +## [3.0.1](https://github.com/jantimon/html-webpack-plugin/compare/v3.0.0...v3.0.1) (2018-03-01) + + +### Bug Fixes + +* **package:** Remove the extract-text-webpack-plugin peer dependency ([57411a9](https://github.com/jantimon/html-webpack-plugin/commit/57411a9)) + +<a name="3.0.0"></a> +## [3.0.0](https://github.com/jantimon/html-webpack-plugin/compare/v2.30.1...v3.0.0) (2018-28-02) + +### Features + +* Add support for the new [webpack tapable](https://github.com/webpack/tapable) to be compatible with webpack 4.x +* Remove bluebird dependency + +### BREAKING CHANGES + +* Similar to webpack 4.x the support for node versions older than 6 are no longer supported + +<a name="2.30.1"></a> +## 2.30.1 + +* Revert part the performance optimization ([#723](https://github.com/jantimon/html-webpack-plugin/pull/723)) because of [#753](https://github.com/jantimon/html-webpack-plugin/issues/753). + +<a name="2.30.0"></a> +## 2.30.0 + +* Add manual sort +* Performance improvements ([#723](https://github.com/jantimon/html-webpack-plugin/pull/723)) + +<a name="2.29.0"></a> +## 2.29.0 + +* Add support for Webpack 3 + +<a name="2.28.0"></a> +## 2.28.0 + +* Backport 3.x void tag for plugin authors + +<a name="2.27.1"></a> +## 2.27.1 + +* Revert 2.25.0 loader resolving + +<a name="2.27.0"></a> +## 2.27.0 + +* Fix a chunksorter webpack 2 issue ([#569](https://github.com/jantimon/html-webpack-plugin/pull/569)) +* Fix template path resolving ([#542](https://github.com/jantimon/html-webpack-plugin/pull/542)) + +<a name="2.26.0"></a> +## 2.26.0 + +* Allow plugins to add attributes without values to the `<script>` and `<link>` tags + +<a name="2.25.0"></a> +## 2.25.0 + +* Clearer loader output +* Add basic support for webpack 2 + +<a name="2.24.1"></a> +## 2.24.1 + +* Hide event deprecated warning of 'applyPluginsAsyncWaterfall' for html-webpack-plugin-after-emit and improve the warning message. + +<a name="2.24.0"></a> +## 2.24.0 + +* Update dependencies +* Add deprecate warning for plugins not returning a result +* Add [path] for favicons + +<a name="2.23.0"></a> +## 2.23.0 + +* Update dependencies +* Stop automated tests for webpack 2 beta because of [#401](https://github.com/jantimon/html-webpack-plugin/issues/401) + +<a name="2.22.0"></a> +## 2.22.0 + +* Update dependencies + +<a name="2.21.1"></a> +## 2.21.1 + +* Better error handling ([#354](https://github.com/jantimon/html-webpack-plugin/pull/354)) + +<a name="2.21.0"></a> +## 2.21.0 + +* Add `html-webpack-plugin-alter-asset-tags` event to allow plugins to adjust the script/link tags + +<a name="2.20.0"></a> +## 2.20.0 + +* Exclude chunks works now even if combined with dependency sort + +<a name="2.19.0"></a> +## 2.19.0 + +* Add `html-webpack-plugin-alter-chunks` event for custom chunk sorting and interpolation + +<a name="2.18.0"></a> +## 2.18.0 + +* Updated all dependencies + +<a name="2.17.0"></a> +## 2.17.0 + +* Add `type` attribute to `script` element to prevent issues in Safari 9.1.1 + +<a name="2.16.2"></a> +## 2.16.2 + +* Fix bug introduced by 2.16.2. Fixes [#315](https://github.com/jantimon/html-webpack-plugin/issues/315) + +<a name="2.16.1"></a> +## 2.16.1 + +* Fix hot module replacement for webpack 2.x + +<a name="2.16.0"></a> +## 2.16.0 + +* Add support for dynamic filenames like index[hash].html + +<a name="2.15.0"></a> +## 2.15.0 + +* Add full unit test coverage for the webpack 2 beta version +* For webpack 2 the default sort will be 'dependency' instead of 'id' +* Upgrade dependencies + +<a name="2.14.0"></a> +## 2.14.0 + +* Export publicPath to the template +* Add example for inlining css and js + +<a name="2.13.0"></a> +## 2.13.0 + +* Add support for absolute output file names +* Add support for relative file names outside the output path + +<a name="2.12.0"></a> +## 2.12.0 + +* Basic Webpack 2.x support #225 + +<a name="2.11.0"></a> +## 2.11.0 + +* Add `xhtml` option which is turned of by default. When activated it will inject self closed `<link href=".." />` tags instead of unclosed `<link href="..">` tags. ([#255](https://github.com/ampedandwired/html-webpack-plugin/pull/255)) +* Add support for webpack placeholders inside the public path e.g. `'/dist/[hash]/'`. ([#249](https://github.com/ampedandwired/html-webpack-plugin/pull/249)) + +<a name="2.10.0"></a> +## 2.10.0 + +* Add `hash` field to the chunk object +* Add `compilation` field to the templateParam object ([#237](https://github.com/ampedandwired/html-webpack-plugin/issues/237)) +* Add `html-webpack-plugin-before-html-generation` event +* Improve error messages + +<a name="2.9.0"></a> +## 2.9.0 + +* Fix favicon path ([#185](https://github.com/ampedandwired/html-webpack-plugin/issues/185), [#208](https://github.com/ampedandwired/html-webpack-plugin/issues/208), [#215](https://github.com/ampedandwired/html-webpack-plugin/pull/215)) + +<a name="2.8.2"></a> +## 2.8.2 + +* Support relative URLs on Windows ([#205](https://github.com/ampedandwired/html-webpack-plugin/issues/205)) + +<a name="2.8.1"></a> +## 2.8.1 + +* Caching improvements ([#204](https://github.com/ampedandwired/html-webpack-plugin/issues/204)) + +<a name="2.8.0"></a> +## 2.8.0 + +* Add `dependency` mode for `chunksSortMode` to sort chunks based on their dependencies with each other + +<a name="2.7.2"></a> +## 2.7.2 + +* Add support for require in js templates + +<a name="2.7.1"></a> +## 2.7.1 + +* Refactoring +* Fix relative windows path + +<a name="2.6.5"></a> +## 2.6.5 + +* Minor refactoring + +<a name="2.6.4"></a> +## 2.6.4 + +* Fix for `"Uncaught TypeError: __webpack_require__(...) is not a function"` +* Fix incomplete cache modules causing "HtmlWebpackPlugin Error: No source available" +* Fix some issues on Windows + +<a name="2.6.3"></a> +## 2.6.3 + +* Prevent parsing the base template with the html-loader + +<a name="2.6.2"></a> +## 2.6.2 + +* Fix `lodash` resolve error ([#172](https://github.com/ampedandwired/html-webpack-plugin/issues/172)) + +<a name="2.6.1"></a> +## 2.6.1 + +* Fix missing module ([#164](https://github.com/ampedandwired/html-webpack-plugin/issues/164)) + +<a name="2.6.0"></a> +## 2.6.0 + +* Move compiler to its own file +* Improve error messages +* Fix global HTML_WEBPACK_PLUGIN variable + +<a name="2.5.0"></a> +## 2.5.0 + +* Support `lodash` template's HTML _"escape"_ delimiter (`<%- %>`) +* Fix bluebird warning ([#130](https://github.com/ampedandwired/html-webpack-plugin/issues/130)) +* Fix an issue where incomplete cache modules were used + +<a name="2.4.0"></a> +## 2.4.0 + +* Don't recompile if the assets didn't change + +<a name="2.3.0"></a> +## 2.3.0 + +* Add events `html-webpack-plugin-before-html-processing`, `html-webpack-plugin-after-html-processing`, `html-webpack-plugin-after-emit` to allow other plugins to alter the html this plugin executes + +<a name="2.2.0"></a> +## 2.2.0 + +* Inject css and js even if the html file is incomplete ([#135](https://github.com/ampedandwired/html-webpack-plugin/issues/135)) +* Update dependencies + +<a name="2.1.0"></a> +## 2.1.0 + +* Synchronize with the stable `@1` version + +<a name="2.0.4"></a> +## 2.0.4 + +* Fix `minify` option +* Fix missing hash interpolation in publicPath + +<a name="2.0.3"></a> +## 2.0.3 + +* Add support for webpack.BannerPlugin + +<a name="2.0.2"></a> +## 2.0.2 + +* Add support for loaders in templates ([#41](https://github.com/ampedandwired/html-webpack-plugin/pull/41)) +* Remove `templateContent` option from configuration +* Better error messages +* Update dependencies + + +<a name="1.7.0"></a> +## 1.7.0 + +* Add `chunksSortMode` option to configuration to control how chunks should be sorted before they are included to the html +* Don't insert async chunks into html ([#95](https://github.com/ampedandwired/html-webpack-plugin/issues/95)) +* Update dependencies + +<a name="1.6.2"></a> +## 1.6.2 + +* Fix paths on Windows +* Fix missing hash interpolation in publicPath +* Allow only `false` or `object` in `minify` configuration option + +<a name="1.6.1"></a> +## 1.6.1 + +* Add `size` field to the chunk object +* Fix stylesheet `<link>`s being discarded when used with `"inject: 'head'"` +* Update dependencies + +<a name="1.6.0"></a> +## 1.6.0 + +* Support placing templates in subfolders +* Don't include chunks with undefined name ([#60](https://github.com/ampedandwired/html-webpack-plugin/pull/60)) +* Don't include async chunks + +<a name="1.5.2"></a> +## 1.5.2 + +* Update dependencies (lodash) + +<a name="1.5.1"></a> +## 1.5.1 + +* Fix error when manifest is specified ([#56](https://github.com/ampedandwired/html-webpack-plugin/issues/56)) + +<a name="1.5.0"></a> +## 1.5.0 + +* Allow to inject javascript files into the head of the html page +* Fix error reporting + +<a name="1.4.0"></a> +## 1.4.0 + +* Add `favicon.ico` option +* Add html minifcation + +<a name="1.2.0"></a> +## 1.2.0 + +* Set charset using HTML5 meta attribute +* Reload upon change when using webpack watch mode +* Generate manifest attribute when using + [appcache-webpack-plugin](https://github.com/lettertwo/appcache-webpack-plugin) +* Optionally add webpack hash as a query string to resources included in the HTML + (`hash: true`) for cache busting +* CSS files generated using webpack (for example, by using the + [extract-text-webpack-plugin](https://github.com/webpack/extract-text-webpack-plugin)) + are now automatically included into the generated HTML +* More detailed information about the files generated by webpack is now available + to templates in the `o.htmlWebpackPlugin.files` attribute. See readme for more + details. This new attribute deprecates the old `o.htmlWebpackPlugin.assets` attribute. +* The `templateContent` option can now be a function that returns the template string to use +* Expose webpack configuration to templates (`o.webpackConfig`) +* Sort chunks to honour dependencies between them (useful for use with CommonsChunkPlugin). diff --git a/node_modules/vuepress-html-webpack-plugin/LICENSE b/node_modules/vuepress-html-webpack-plugin/LICENSE new file mode 100644 index 00000000..8c11fc72 --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/LICENSE @@ -0,0 +1,20 @@ +Copyright JS Foundation and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/vuepress-html-webpack-plugin/README.md b/node_modules/vuepress-html-webpack-plugin/README.md new file mode 100644 index 00000000..1f490cb4 --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/README.md @@ -0,0 +1,419 @@ +# Fork + +This is published as `vuepress-html-webpack-plugin` to be used in VuePress. This is to fix a situation when the user installs a version of `html-webpack-plugin` that is compatible with VuePress' (which causes it to be hoisted to `node_modules` root) but also with a version of webpack that is incompatible. Because `html-webpack-plugin` directly make requires into webpack internals, it ends up requiring the internal modules from the incompatible version of webpack. + +[![npm][npm]][npm-url] +[![node][node]][node-url] + +[![deps][deps]][deps-url] +[![tests][tests]][tests-url] +[](#backers) + [](#sponsors) + +<div align="center"> + <img width="200" height="200" src="https://worldvectorlogo.com/logos/html5.svg"> + <a href="https://github.com/webpack/webpack"> + <img width="200" height="200" + src="https://webpack.js.org/assets/icon-square-big.svg"> + </a> + <div> + <img width="100" height="100" title="Webpack Plugin" src="http://michael-ciniawsky.github.io/postcss-load-plugins/logo.svg"> + </div> + <h1>HTML Webpack Plugin</h1> + <p>Plugin that simplifies creation of HTML files to serve your bundles</p> +</div> + +<h2 align="center">Install</h2> + + +```bash + npm i --save-dev html-webpack-plugin +``` + +```bash + yarn add --dev html-webpack-plugin +``` + + + +This is a [webpack](http://webpack.js.org/) plugin that simplifies creation of HTML files to serve your `webpack` bundles. This is especially useful for `webpack` bundles that include a hash in the filename which changes every compilation. You can either let the plugin generate an HTML file for you, supply +your own template using `lodash` templates or use your own loader. + +### `Plugins` + +The `html-webpack-plugin` provides [hooks](https://github.com/jantimon/html-webpack-plugin#events) to extend it to your needs. There are already some really powerful plugins which can be integrated with zero configuration + + * [webpack-subresource-integrity](https://www.npmjs.com/package/webpack-subresource-integrity) for enhanced asset security + * [appcache-webpack-plugin](https://github.com/lettertwo/appcache-webpack-plugin) for iOS and Android offline usage + * [favicons-webpack-plugin](https://github.com/jantimon/favicons-webpack-plugin) which generates favicons and icons for iOS, Android and desktop browsers + * [html-webpack-harddisk-plugin](https://github.com/jantimon/html-webpack-harddisk-plugin) can be used to always write to disk the html file, useful when webpack-dev-server / HMR are being used + * [html-webpack-inline-source-plugin](https://github.com/DustinJackson/html-webpack-inline-source-plugin) to inline your assets in the resulting HTML file + * [html-webpack-inline-svg-plugin](https://github.com/thegc/html-webpack-inline-svg-plugin) to inline SVGs in the resulting HTML file. + * [html-webpack-exclude-assets-plugin](https://github.com/jamesjieye/html-webpack-exclude-assets-plugin) for excluding assets using regular expressions + * [html-webpack-include-assets-plugin](https://github.com/jharris4/html-webpack-include-assets-plugin) for including lists of js or css file paths (such as those copied by the copy-webpack-plugin). + * [script-ext-html-webpack-plugin](https://github.com/numical/script-ext-html-webpack-plugin) to add `async`, `defer` or `module` attributes to your `<script>` elements, or even inline them + * [style-ext-html-webpack-plugin](https://github.com/numical/style-ext-html-webpack-plugin) to convert your `<link>`s to external stylesheets into `<style>` elements containing internal CSS + * [resource-hints-webpack-plugin](https://github.com/jantimon/resource-hints-webpack-plugin) to add resource hints for faster initial page loads using `<link rel='preload'>` and `<link rel='prefetch'>` + * [preload-webpack-plugin](https://github.com/GoogleChrome/preload-webpack-plugin) for automatically wiring up asynchronous (and other types) of JavaScript chunks using `<link rel='preload'>` helping with lazy-loading + * [link-media-html-webpack-plugin](https://github.com/yaycmyk/link-media-html-webpack-plugin) allows for injected stylesheet `<link />` tags to have their media attribute set automatically; useful for providing specific desktop/mobile/print etc. stylesheets that the browser will conditionally download + * [inline-chunk-manifest-html-webpack-plugin](https://github.com/jouni-kantola/inline-chunk-manifest-html-webpack-plugin) for inlining webpack's chunk manifest. Default extracts manifest and inlines in `<head>` + * [html-webpack-inline-style-plugin](https://github.com/djaax/html-webpack-inline-style-plugin) for inlining styles to HTML elements using [juice](https://github.com/Automattic/juice). Useful for email generation automatisation. + * [html-webpack-exclude-empty-assets-plugin](https://github.com/KnisterPeter/html-webpack-exclude-empty-assets-plugin) removes empty assets from being added to the html. This fixes some problems with extract-text-plugin with webpack 4. + * [webpack-concat-plugin](https://github.com/hxlniada/webpack-concat-plugin) for concat and uglify files that needn't to be webpack bundles(for legacy files) and inject to html-webpack-plugin. + + +<h2 align="center">Usage</h2> + +The plugin will generate an HTML5 file for you that includes all your `webpack` +bundles in the body using `script` tags. Just add the plugin to your `webpack` +config as follows: + +**webpack.config.js** +```js +const HtmlWebpackPlugin = require('html-webpack-plugin') + +module.exports = { + entry: 'index.js', + output: { + path: __dirname + '/dist', + filename: 'index_bundle.js' + }, + plugins: [ + new HtmlWebpackPlugin() + ] +} +``` + +This will generate a file `dist/index.html` containing the following + +```html +<!DOCTYPE html> +<html> + <head> + <meta charset="UTF-8"> + <title>Webpack App</title> + </head> + <body> + <script src="index_bundle.js"></script> + </body> +</html> +``` + +If you have multiple `webpack` entry points, they will all be included with `script` tags in the generated HTML. + +If you have any CSS assets in webpack's output (for example, CSS extracted with the [ExtractTextPlugin](https://github.com/webpack/extract-text-webpack-plugin)) +then these will be included with `<link>` tags in the HTML head. + +If you have plugins that make use of it, `html-webpack-plugin` should be ordered first before any of the integrated plugins. + +<h2 align="center">Options</h2> + +You can pass a hash of configuration options to `html-webpack-plugin`. +Allowed values are as follows + +|Name|Type|Default|Description| +|:--:|:--:|:-----:|:----------| +|**[`title`](#)**|`{String}`|``|The title to use for the generated HTML document| +|**[`filename`](#)**|`{String}`|`'index.html'`|The file to write the HTML to. Defaults to `index.html`. You can specify a subdirectory here too (eg: `assets/admin.html`)| +|**[`template`](#)**|`{String}`|``|`webpack` require path to the template. Please see the [docs](https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md) for details| +|**[`templateParameters`](#)**|`{Boolean\|Object\|Function}`|``| Allows to overwrite the parameters used in the template | +|**[`inject`](#)**|`{Boolean\|String}`|`true`|`true \|\| 'head' \|\| 'body' \|\| false` Inject all assets into the given `template` or `templateContent`. When passing `true` or `'body'` all javascript resources will be placed at the bottom of the body element. `'head'` will place the scripts in the head element| +|**[`favicon`](#)**|`{String}`|``|Adds the given favicon path to the output HTML| +|**[`meta`](#)**|`{Object}`|`{}`|Allows to inject `meta`-tags. E.g. `meta: {viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no'}`| +|**[`minify`](#)**|`{Boolean\|Object}`|`true`|Pass [html-minifier](https://github.com/kangax/html-minifier#options-quick-reference)'s options as object to minify the output| +|**[`hash`](#)**|`{Boolean}`|`false`|If `true` then append a unique `webpack` compilation hash to all included scripts and CSS files. This is useful for cache busting| +|**[`cache`](#)**|`{Boolean}`|`true`|Emit the file only if it was changed| +|**[`showErrors`](#)**|`{Boolean}`|`true`|Errors details will be written into the HTML page| +|**[`chunks`](#)**|`{?}`|`?`|Allows you to add only some chunks (e.g only the unit-test chunk)| +|**[`chunksSortMode`](#plugins)**|`{String\|Function}`|`auto`|Allows to control how chunks should be sorted before they are included to the HTML. Allowed values are `'none' \| 'auto' \| 'dependency' \| 'manual' \| {Function}`| +|**[`excludeChunks`](#)**|`{Array.<string>}`|``|Allows you to skip some chunks (e.g don't add the unit-test chunk)| +|**[`xhtml`](#)**|`{Boolean}`|`false`|If `true` render the `link` tags as self-closing (XHTML compliant)| + +Here's an example webpack config illustrating how to use these options + +**webpack.config.js** +```js +{ + entry: 'index.js', + output: { + path: __dirname + '/dist', + filename: 'index_bundle.js' + }, + plugins: [ + new HtmlWebpackPlugin({ + title: 'My App', + filename: 'assets/admin.html' + }) + ] +} +``` + +### `Generating Multiple HTML Files` + +To generate more than one HTML file, declare the plugin more than +once in your plugins array + +**webpack.config.js** +```js +{ + entry: 'index.js', + output: { + path: __dirname + '/dist', + filename: 'index_bundle.js' + }, + plugins: [ + new HtmlWebpackPlugin(), // Generates default index.html + new HtmlWebpackPlugin({ // Also generate a test.html + filename: 'test.html', + template: 'src/assets/test.html' + }) + ] +} +``` + +### `Writing Your Own Templates` + +If the default generated HTML doesn't meet your needs you can supply +your own template. The easiest way is to use the `template` option and pass a custom HTML file. +The html-webpack-plugin will automatically inject all necessary CSS, JS, manifest +and favicon files into the markup. + +```js +plugins: [ + new HtmlWebpackPlugin({ + title: 'Custom template', + // Load a custom template (lodash by default see the FAQ for details) + template: 'index.html' + }) +] +``` + +**index.html** +```html +<!DOCTYPE html> +<html> + <head> + <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> + <title><%= htmlWebpackPlugin.options.title %></title> + </head> + <body> + </body> +</html> +``` + +If you already have a template loader, you can use it to parse the template. +Please note that this will also happen if you specifiy the html-loader and use `.html` file as template. + +**webpack.config.js** +```js +module: { + loaders: [ + { test: /\.hbs$/, loader: "handlebars" } + ] +}, +plugins: [ + new HtmlWebpackPlugin({ + title: 'Custom template using Handlebars', + template: 'index.hbs' + }) +] +``` + +You can use the `lodash` syntax out of the box. If the `inject` feature doesn't fit your needs and you want full control over the asset placement use the [default template](https://github.com/jaketrent/html-webpack-template/blob/86f285d5c790a6c15263f5cc50fd666d51f974fd/index.html) of the [html-webpack-template project](https://github.com/jaketrent/html-webpack-template) as a starting point for writing your own. + +The following variables are available in the template: +- `htmlWebpackPlugin`: data specific to this plugin + - `htmlWebpackPlugin.files`: a massaged representation of the + `assetsByChunkName` attribute of webpack's [stats](https://github.com/webpack/docs/wiki/node.js-api#stats) + object. It contains a mapping from entry point name to the bundle filename, eg: + ```json + "htmlWebpackPlugin": { + "files": { + "css": [ "main.css" ], + "js": [ "assets/head_bundle.js", "assets/main_bundle.js"], + "chunks": { + "head": { + "entry": "assets/head_bundle.js", + "css": [ "main.css" ] + }, + "main": { + "entry": "assets/main_bundle.js", + "css": [] + }, + } + } + } + ``` + If you've set a publicPath in your webpack config this will be reflected + correctly in this assets hash. + + - `htmlWebpackPlugin.options`: the options hash that was passed to + the plugin. In addition to the options actually used by this plugin, + you can use this hash to pass arbitrary data through to your template. + +- `webpack`: the webpack [stats](https://github.com/webpack/docs/wiki/node.js-api#stats) + object. Note that this is the stats object as it was at the time the HTML template + was emitted and as such may not have the full set of stats that are available + after the webpack run is complete. + +- `webpackConfig`: the webpack configuration that was used for this compilation. This + can be used, for example, to get the `publicPath` (`webpackConfig.output.publicPath`). + +- `compilation`: the webpack [compilation](https://webpack.js.org/api/compilation/) object. + This can be used, for example, to get the contents of processed assets and inline them + directly in the page, through `compilation.assets[...].source()` + (see [the inline template example](examples/inline/template.jade)). + + +### `Filtering Chunks` + +To include only certain chunks you can limit the chunks being used + +**webpack.config.js** +```js +plugins: [ + new HtmlWebpackPlugin({ + chunks: ['app'] + }) +] +``` + +It is also possible to exclude certain chunks by setting the `excludeChunks` option + +**webpack.config.js** +```js +plugins: [ + new HtmlWebpackPlugin({ + excludeChunks: [ 'dev-helper' ] + }) +] +``` + +### `Events` + +To allow other [plugins](https://github.com/webpack/docs/wiki/plugins) to alter the HTML this plugin executes the following events: + +#### `Sync` + +* `html-webpack-plugin-alter-chunks` + +#### `Async` + +* `html-webpack-plugin-before-html-generation` +* `html-webpack-plugin-before-html-processing` +* `html-webpack-plugin-alter-asset-tags` +* `html-webpack-plugin-after-html-processing` +* `html-webpack-plugin-after-emit` + +Example implementation: [html-webpack-harddisk-plugin](https://github.com/jantimon/html-webpack-harddisk-plugin) + +**plugin.js** +```js +function MyPlugin(options) { + // Configure your plugin with options... +} + +MyPlugin.prototype.apply = function (compiler) { + compiler.plugin('compilation', (compilation) => { + console.log('The compiler is starting a new compilation...'); + + compilation.plugin( + 'html-webpack-plugin-before-html-processing', + (data, cb) => { + data.html += 'The Magic Footer' + + cb(null, data) + } + ) + }) +} + +module.exports = MyPlugin +``` + +**webpack.config.js** +```js +plugins: [ + new MyPlugin({ options: '' }) +] +``` + +Note that the callback must be passed the HtmlWebpackPluginData in order to pass this onto any other plugins listening on the same `html-webpack-plugin-before-html-processing` event + +<h2 align="center">Maintainers</h2> + +<table> + <tbody> + <tr> + <td align="center"> + <img width="150" height="150" + src="https://avatars3.githubusercontent.com/u/4113649?v=3&s=150"> + </br> + <a href="https://github.com/jantimon">Jan Nicklas</a> + </td> + <td align="center"> + <img width="150" height="150" + src="https://avatars2.githubusercontent.com/u/4112409?v=3&s=150"> + </br> + <a href="https://github.com/mastilver">Thomas Sileghem</a> + </td> + </tr> + <tbody> +</table> + + +[npm]: https://img.shields.io/npm/v/html-webpack-plugin.svg +[npm-url]: https://npmjs.com/package/html-webpack-plugin + +[node]: https://img.shields.io/node/v/html-webpack-plugin.svg +[node-url]: https://nodejs.org + +[deps]: https://david-dm.org/jantimon/html-webpack-plugin.svg +[deps-url]: https://david-dm.org/jantimon/html-webpack-plugin + +[tests]: http://img.shields.io/travis/jantimon/html-webpack-plugin.svg +[tests-url]: https://travis-ci.org/jantimon/html-webpack-plugin + + +## Contributors + +This project exists thanks to all the people who contribute. + +You're free to contribute to this project by submitting [issues](https://github.com/jantimon/html-webpack-plugin/issues) and/or [pull requests](https://github.com/jantimon/html-webpack-plugin/pulls). This project is test-driven, so keep in mind that every change and new feature should be covered by tests. + +This project uses the [semistandard code style](https://github.com/Flet/semistandard). + +<a href="https://github.com/jantimon/html-webpack-plugin/graphs/contributors"><img src="https://opencollective.com/html-webpack-plugin/contributors.svg?width=890&button=false" /></a> + + +## Backers + +Thank you to all our backers! ๐ [Become a backer](https://opencollective.com/html-webpack-plugin#backer) + +<a href="https://opencollective.com/html-webpack-plugin/backer/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/backer/0/avatar.svg?requireActive=false"></a> +<a href="https://opencollective.com/html-webpack-plugin/backer/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/backer/1/avatar.svg?requireActive=false"></a> +<a href="https://opencollective.com/html-webpack-plugin/backer/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/backer/2/avatar.svg?requireActive=false"></a> +<a href="https://opencollective.com/html-webpack-plugin/backer/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/backer/3/avatar.svg?requireActive=false"></a> +<a href="https://opencollective.com/html-webpack-plugin/backer/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/backer/4/avatar.svg?requireActive=false"></a> +<a href="https://opencollective.com/html-webpack-plugin/backer/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/backer/5/avatar.svg?requireActive=false"></a> +<a href="https://opencollective.com/html-webpack-plugin/backer/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/backer/6/avatar.svg?requireActive=false"></a> +<a href="https://opencollective.com/html-webpack-plugin/backer/7/website?requireActive=false" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/backer/7/avatar.svg?requireActive=false"></a> +<a href="https://opencollective.com/html-webpack-plugin/backer/8/website?requireActive=false" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/backer/8/avatar.svg?requireActive=false"></a> +<a href="https://opencollective.com/html-webpack-plugin/backer/9/website?requireActive=false" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/backer/9/avatar.svg?requireActive=false"></a> + +## Sponsors + +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor](https://opencollective.com/html-webpack-plugin#sponsor) + +<a href="https://opencollective.com/html-webpack-plugin/sponsor/0/website" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/sponsor/0/avatar.svg"></a> +<a href="https://opencollective.com/html-webpack-plugin/sponsor/1/website" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/sponsor/1/avatar.svg"></a> +<a href="https://opencollective.com/html-webpack-plugin/sponsor/2/website" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/sponsor/2/avatar.svg"></a> +<a href="https://opencollective.com/html-webpack-plugin/sponsor/3/website" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/sponsor/3/avatar.svg"></a> +<a href="https://opencollective.com/html-webpack-plugin/sponsor/4/website" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/sponsor/4/avatar.svg"></a> +<a href="https://opencollective.com/html-webpack-plugin/sponsor/5/website" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/sponsor/5/avatar.svg"></a> +<a href="https://opencollective.com/html-webpack-plugin/sponsor/6/website" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/sponsor/6/avatar.svg"></a> +<a href="https://opencollective.com/html-webpack-plugin/sponsor/7/website" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/sponsor/7/avatar.svg"></a> +<a href="https://opencollective.com/html-webpack-plugin/sponsor/8/website" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/sponsor/8/avatar.svg"></a> +<a href="https://opencollective.com/html-webpack-plugin/sponsor/9/website" target="_blank"><img src="https://opencollective.com/html-webpack-plugin/sponsor/9/avatar.svg"></a> + + diff --git a/node_modules/vuepress-html-webpack-plugin/default_index.ejs b/node_modules/vuepress-html-webpack-plugin/default_index.ejs new file mode 100644 index 00000000..f9466a46 --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/default_index.ejs @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="UTF-8"> + <title><%= htmlWebpackPlugin.options.title %></title> + </head> + <body> + </body> +</html>
\ No newline at end of file diff --git a/node_modules/vuepress-html-webpack-plugin/index.js b/node_modules/vuepress-html-webpack-plugin/index.js new file mode 100644 index 00000000..55a357dc --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/index.js @@ -0,0 +1,729 @@ +'use strict'; + +// use Polyfill for util.promisify in node versions < v8 +const promisify = require('util.promisify'); + +const vm = require('vm'); +const fs = require('fs'); +const _ = require('lodash'); +const path = require('path'); +const childCompiler = require('./lib/compiler.js'); +const prettyError = require('./lib/errors.js'); +const chunkSorter = require('./lib/chunksorter.js'); + +const fsStatAsync = promisify(fs.stat); +const fsReadFileAsync = promisify(fs.readFile); + +class HtmlWebpackPlugin { + constructor (options) { + // Default options + this.options = _.extend({ + template: path.join(__dirname, 'default_index.ejs'), + templateParameters: templateParametersGenerator, + filename: 'index.html', + hash: false, + inject: true, + compile: true, + favicon: false, + minify: false, + cache: true, + showErrors: true, + chunks: 'all', + excludeChunks: [], + chunksSortMode: 'auto', + meta: {}, + title: 'Webpack App', + xhtml: false + }, options); + } + + apply (compiler) { + const self = this; + let isCompilationCached = false; + let compilationPromise; + + this.options.template = this.getFullTemplatePath(this.options.template, compiler.context); + + // convert absolute filename into relative so that webpack can + // generate it at correct location + const filename = this.options.filename; + if (path.resolve(filename) === path.normalize(filename)) { + this.options.filename = path.relative(compiler.options.output.path, filename); + } + + // setup hooks for webpack 4 + if (compiler.hooks) { + compiler.hooks.compilation.tap('HtmlWebpackPluginHooks', compilation => { + const SyncWaterfallHook = require('tapable').SyncWaterfallHook; + const AsyncSeriesWaterfallHook = require('tapable').AsyncSeriesWaterfallHook; + compilation.hooks.htmlWebpackPluginAlterChunks = new SyncWaterfallHook(['chunks', 'objectWithPluginRef']); + compilation.hooks.htmlWebpackPluginBeforeHtmlGeneration = new AsyncSeriesWaterfallHook(['pluginArgs']); + compilation.hooks.htmlWebpackPluginBeforeHtmlProcessing = new AsyncSeriesWaterfallHook(['pluginArgs']); + compilation.hooks.htmlWebpackPluginAlterAssetTags = new AsyncSeriesWaterfallHook(['pluginArgs']); + compilation.hooks.htmlWebpackPluginAfterHtmlProcessing = new AsyncSeriesWaterfallHook(['pluginArgs']); + compilation.hooks.htmlWebpackPluginAfterEmit = new AsyncSeriesWaterfallHook(['pluginArgs']); + }); + } + + // Backwards compatible version of: compiler.hooks.make.tapAsync() + (compiler.hooks ? compiler.hooks.make.tapAsync.bind(compiler.hooks.make, 'HtmlWebpackPlugin') : compiler.plugin.bind(compiler, 'make'))((compilation, callback) => { + // Compile the template (queued) + compilationPromise = childCompiler.compileTemplate(self.options.template, compiler.context, self.options.filename, compilation) + .catch(err => { + compilation.errors.push(prettyError(err, compiler.context).toString()); + return { + content: self.options.showErrors ? prettyError(err, compiler.context).toJsonHtml() : 'ERROR', + outputName: self.options.filename + }; + }) + .then(compilationResult => { + // If the compilation change didnt change the cache is valid + isCompilationCached = compilationResult.hash && self.childCompilerHash === compilationResult.hash; + self.childCompilerHash = compilationResult.hash; + self.childCompilationOutputName = compilationResult.outputName; + callback(); + return compilationResult.content; + }); + }); + + // Backwards compatible version of: compiler.plugin.emit.tapAsync() + (compiler.hooks ? compiler.hooks.emit.tapAsync.bind(compiler.hooks.emit, 'HtmlWebpackPlugin') : compiler.plugin.bind(compiler, 'emit'))((compilation, callback) => { + const applyPluginsAsyncWaterfall = self.applyPluginsAsyncWaterfall(compilation); + // Get chunks info as json + // Note: we're excluding stuff that we don't need to improve toJson serialization speed. + const chunkOnlyConfig = { + assets: false, + cached: false, + children: false, + chunks: true, + chunkModules: false, + chunkOrigins: false, + errorDetails: false, + hash: false, + modules: false, + reasons: false, + source: false, + timings: false, + version: false + }; + const allChunks = compilation.getStats().toJson(chunkOnlyConfig).chunks; + // Filter chunks (options.chunks and options.excludeCHunks) + let chunks = self.filterChunks(allChunks, self.options.chunks, self.options.excludeChunks); + // Sort chunks + chunks = self.sortChunks(chunks, self.options.chunksSortMode, compilation); + // Let plugins alter the chunks and the chunk sorting + if (compilation.hooks) { + chunks = compilation.hooks.htmlWebpackPluginAlterChunks.call(chunks, { plugin: self }); + } else { + // Before Webpack 4 + chunks = compilation.applyPluginsWaterfall('html-webpack-plugin-alter-chunks', chunks, { plugin: self }); + } + // Get assets + const assets = self.htmlWebpackPluginAssets(compilation, chunks); + // If this is a hot update compilation, move on! + // This solves a problem where an `index.html` file is generated for hot-update js files + // It only happens in Webpack 2, where hot updates are emitted separately before the full bundle + if (self.isHotUpdateCompilation(assets)) { + return callback(); + } + + // If the template and the assets did not change we don't have to emit the html + const assetJson = JSON.stringify(self.getAssetFiles(assets)); + if (isCompilationCached && self.options.cache && assetJson === self.assetJson) { + return callback(); + } else { + self.assetJson = assetJson; + } + + Promise.resolve() + // Favicon + .then(() => { + if (self.options.favicon) { + return self.addFileToAssets(self.options.favicon, compilation) + .then(faviconBasename => { + let publicPath = compilation.mainTemplate.getPublicPath({hash: compilation.hash}) || ''; + if (publicPath && publicPath.substr(-1) !== '/') { + publicPath += '/'; + } + assets.favicon = publicPath + faviconBasename; + }); + } + }) + // Wait for the compilation to finish + .then(() => compilationPromise) + .then(compiledTemplate => { + // Allow to use a custom function / string instead + if (self.options.templateContent !== undefined) { + return self.options.templateContent; + } + // Once everything is compiled evaluate the html factory + // and replace it with its content + return self.evaluateCompilationResult(compilation, compiledTemplate); + }) + // Allow plugins to make changes to the assets before invoking the template + // This only makes sense to use if `inject` is `false` + .then(compilationResult => applyPluginsAsyncWaterfall('html-webpack-plugin-before-html-generation', false, { + assets: assets, + outputName: self.childCompilationOutputName, + plugin: self + }) + .then(() => compilationResult)) + // Execute the template + .then(compilationResult => typeof compilationResult !== 'function' + ? compilationResult + : self.executeTemplate(compilationResult, chunks, assets, compilation)) + // Allow plugins to change the html before assets are injected + .then(html => { + const pluginArgs = {html: html, assets: assets, plugin: self, outputName: self.childCompilationOutputName}; + return applyPluginsAsyncWaterfall('html-webpack-plugin-before-html-processing', true, pluginArgs); + }) + .then(result => { + const html = result.html; + const assets = result.assets; + // Prepare script and link tags + const assetTags = self.generateHtmlTags(assets); + const pluginArgs = {head: assetTags.head, body: assetTags.body, plugin: self, chunks: chunks, outputName: self.childCompilationOutputName}; + // Allow plugins to change the assetTag definitions + return applyPluginsAsyncWaterfall('html-webpack-plugin-alter-asset-tags', true, pluginArgs) + .then(result => self.postProcessHtml(html, assets, { body: result.body, head: result.head }) + .then(html => _.extend(result, {html: html, assets: assets}))); + }) + // Allow plugins to change the html after assets are injected + .then(result => { + const html = result.html; + const assets = result.assets; + const pluginArgs = {html: html, assets: assets, plugin: self, outputName: self.childCompilationOutputName}; + return applyPluginsAsyncWaterfall('html-webpack-plugin-after-html-processing', true, pluginArgs) + .then(result => result.html); + }) + .catch(err => { + // In case anything went wrong the promise is resolved + // with the error message and an error is logged + compilation.errors.push(prettyError(err, compiler.context).toString()); + // Prevent caching + self.hash = null; + return self.options.showErrors ? prettyError(err, compiler.context).toHtml() : 'ERROR'; + }) + .then(html => { + // Replace the compilation result with the evaluated html code + compilation.assets[self.childCompilationOutputName] = { + source: () => html, + size: () => html.length + }; + }) + .then(() => applyPluginsAsyncWaterfall('html-webpack-plugin-after-emit', false, { + html: compilation.assets[self.childCompilationOutputName], + outputName: self.childCompilationOutputName, + plugin: self + }).catch(err => { + console.error(err); + return null; + }).then(() => null)) + // Let webpack continue with it + .then(() => { + callback(); + }); + }); + } + + /** + * Evaluates the child compilation result + * Returns a promise + */ + evaluateCompilationResult (compilation, source) { + if (!source) { + return Promise.reject('The child compilation didn\'t provide a result'); + } + + // The LibraryTemplatePlugin stores the template result in a local variable. + // To extract the result during the evaluation this part has to be removed. + source = source.replace('var HTML_WEBPACK_PLUGIN_RESULT =', ''); + const template = this.options.template.replace(/^.+!/, '').replace(/\?.+$/, ''); + const vmContext = vm.createContext(_.extend({HTML_WEBPACK_PLUGIN: true, require: require}, global)); + const vmScript = new vm.Script(source, {filename: template}); + // Evaluate code and cast to string + let newSource; + try { + newSource = vmScript.runInContext(vmContext); + } catch (e) { + return Promise.reject(e); + } + if (typeof newSource === 'object' && newSource.__esModule && newSource.default) { + newSource = newSource.default; + } + return typeof newSource === 'string' || typeof newSource === 'function' + ? Promise.resolve(newSource) + : Promise.reject('The loader "' + this.options.template + '" didn\'t return html.'); + } + + /** + * Generate the template parameters for the template function + */ + getTemplateParameters (compilation, assets) { + if (typeof this.options.templateParameters === 'function') { + return this.options.templateParameters(compilation, assets, this.options); + } + if (typeof this.options.templateParameters === 'object') { + return this.options.templateParameters; + } + return {}; + } + + /** + * Html post processing + * + * Returns a promise + */ + executeTemplate (templateFunction, chunks, assets, compilation) { + return Promise.resolve() + // Template processing + .then(() => { + const templateParams = this.getTemplateParameters(compilation, assets); + let html = ''; + try { + html = templateFunction(templateParams); + } catch (e) { + compilation.errors.push(new Error('Template execution failed: ' + e)); + return Promise.reject(e); + } + return html; + }); + } + + /** + * Html post processing + * + * Returns a promise + */ + postProcessHtml (html, assets, assetTags) { + const self = this; + if (typeof html !== 'string') { + return Promise.reject('Expected html to be a string but got ' + JSON.stringify(html)); + } + return Promise.resolve() + // Inject + .then(() => { + if (self.options.inject) { + return self.injectAssetsIntoHtml(html, assets, assetTags); + } else { + return html; + } + }) + // Minify + .then(html => { + if (self.options.minify) { + const minify = require('html-minifier').minify; + return minify(html, self.options.minify); + } + return html; + }); + } + + /* + * Pushes the content of the given filename to the compilation assets + */ + addFileToAssets (filename, compilation) { + filename = path.resolve(compilation.compiler.context, filename); + return Promise.all([ + fsStatAsync(filename), + fsReadFileAsync(filename) + ]) + .then(([size, source]) => { + return { + size, + source + }; + }) + .catch(() => Promise.reject(new Error('HtmlWebpackPlugin: could not load file ' + filename))) + .then(results => { + const basename = path.basename(filename); + if (compilation.fileDependencies.add) { + compilation.fileDependencies.add(filename); + } else { + // Before Webpack 4 - fileDepenencies was an array + compilation.fileDependencies.push(filename); + } + compilation.assets[basename] = { + source: () => results.source, + size: () => results.size.size + }; + return basename; + }); + } + + /** + * Helper to sort chunks + */ + sortChunks (chunks, sortMode, compilation) { + // Custom function + if (typeof sortMode === 'function') { + return chunks.sort(sortMode); + } + // Check if the given sort mode is a valid chunkSorter sort mode + if (typeof chunkSorter[sortMode] !== 'undefined') { + return chunkSorter[sortMode](chunks, this.options, compilation); + } + throw new Error('"' + sortMode + '" is not a valid chunk sort mode'); + } + + /** + * Return all chunks from the compilation result which match the exclude and include filters + */ + filterChunks (chunks, includedChunks, excludedChunks) { + return chunks.filter(chunk => { + const chunkName = chunk.names[0]; + // This chunk doesn't have a name. This script can't handled it. + if (chunkName === undefined) { + return false; + } + // Skip if the chunk should be lazy loaded + if (typeof chunk.isInitial === 'function') { + if (!chunk.isInitial()) { + return false; + } + } else if (!chunk.initial) { + return false; + } + // Skip if the chunks should be filtered and the given chunk was not added explicity + if (Array.isArray(includedChunks) && includedChunks.indexOf(chunkName) === -1) { + return false; + } + // Skip if the chunks should be filtered and the given chunk was excluded explicity + if (Array.isArray(excludedChunks) && excludedChunks.indexOf(chunkName) !== -1) { + return false; + } + // Add otherwise + return true; + }); + } + + isHotUpdateCompilation (assets) { + return assets.js.length && assets.js.every(name => /\.hot-update\.js$/.test(name)); + } + + htmlWebpackPluginAssets (compilation, chunks) { + const self = this; + const compilationHash = compilation.hash; + + // Use the configured public path or build a relative path + let publicPath = typeof compilation.options.output.publicPath !== 'undefined' + // If a hard coded public path exists use it + ? compilation.mainTemplate.getPublicPath({hash: compilationHash}) + // If no public path was set get a relative url path + : path.relative(path.resolve(compilation.options.output.path, path.dirname(self.childCompilationOutputName)), compilation.options.output.path) + .split(path.sep).join('/'); + + if (publicPath.length && publicPath.substr(-1, 1) !== '/') { + publicPath += '/'; + } + + const assets = { + // The public path + publicPath: publicPath, + // Will contain all js & css files by chunk + chunks: {}, + // Will contain all js files + js: [], + // Will contain all css files + css: [], + // Will contain the html5 appcache manifest files if it exists + manifest: Object.keys(compilation.assets).filter(assetFile => path.extname(assetFile) === '.appcache')[0] + }; + + // Append a hash for cache busting + if (this.options.hash) { + assets.manifest = self.appendHash(assets.manifest, compilationHash); + assets.favicon = self.appendHash(assets.favicon, compilationHash); + } + + for (let i = 0; i < chunks.length; i++) { + const chunk = chunks[i]; + const chunkName = chunk.names[0]; + + assets.chunks[chunkName] = {}; + + // Prepend the public path to all chunk files + let chunkFiles = [].concat(chunk.files).map(chunkFile => publicPath + chunkFile); + + // Append a hash for cache busting + if (this.options.hash) { + chunkFiles = chunkFiles.map(chunkFile => self.appendHash(chunkFile, compilationHash)); + } + + // Webpack outputs an array for each chunk when using sourcemaps + // or when one chunk hosts js and css simultaneously + const js = chunkFiles.find(chunkFile => /.js($|\?)/.test(chunkFile)); + if (js) { + assets.chunks[chunkName].size = chunk.size; + assets.chunks[chunkName].entry = js; + assets.chunks[chunkName].hash = chunk.hash; + assets.js.push(js); + } + + // Gather all css files + const css = chunkFiles.filter(chunkFile => /.css($|\?)/.test(chunkFile)); + assets.chunks[chunkName].css = css; + assets.css = assets.css.concat(css); + } + + // Duplicate css assets can occur on occasion if more than one chunk + // requires the same css. + assets.css = _.uniq(assets.css); + + return assets; + } + + /** + * Generate meta tags + */ + getMetaTags () { + if (this.options.meta === false) { + return []; + } + // Make tags self-closing in case of xhtml + // Turn { "viewport" : "width=500, initial-scale=1" } into + // [{ name:"viewport" content:"width=500, initial-scale=1" }] + const selfClosingTag = !!this.options.xhtml; + const metaTagAttributeObjects = Object.keys(this.options.meta).map((metaName) => { + const metaTagContent = this.options.meta[metaName]; + return (typeof metaTagContent === 'object') ? metaTagContent : { + name: metaName, + content: metaTagContent + }; + }); + // Turn [{ name:"viewport" content:"width=500, initial-scale=1" }] into + // the html-webpack-plugin tag structure + return metaTagAttributeObjects.map((metaTagAttributes) => { + return { + tagName: 'meta', + voidTag: true, + selfClosingTag: selfClosingTag, + attributes: metaTagAttributes + }; + }); + } + + /** + * Injects the assets into the given html string + */ + generateHtmlTags (assets) { + // Turn script files into script tags + const scripts = assets.js.map(scriptPath => ({ + tagName: 'script', + closeTag: true, + attributes: { + type: 'text/javascript', + src: scriptPath + } + })); + // Make tags self-closing in case of xhtml + const selfClosingTag = !!this.options.xhtml; + // Turn css files into link tags + const styles = assets.css.map(stylePath => ({ + tagName: 'link', + selfClosingTag: selfClosingTag, + voidTag: true, + attributes: { + href: stylePath, + rel: 'stylesheet' + } + })); + // Injection targets + let head = this.getMetaTags(); + let body = []; + + // If there is a favicon present, add it to the head + if (assets.favicon) { + head.push({ + tagName: 'link', + selfClosingTag: selfClosingTag, + voidTag: true, + attributes: { + rel: 'shortcut icon', + href: assets.favicon + } + }); + } + // Add styles to the head + head = head.concat(styles); + // Add scripts to body or head + if (this.options.inject === 'head') { + head = head.concat(scripts); + } else { + body = body.concat(scripts); + } + return {head: head, body: body}; + } + + /** + * Injects the assets into the given html string + */ + injectAssetsIntoHtml (html, assets, assetTags) { + const htmlRegExp = /(<html[^>]*>)/i; + const headRegExp = /(<\/head\s*>)/i; + const bodyRegExp = /(<\/body\s*>)/i; + const body = assetTags.body.map(this.createHtmlTag.bind(this)); + const head = assetTags.head.map(this.createHtmlTag.bind(this)); + + if (body.length) { + if (bodyRegExp.test(html)) { + // Append assets to body element + html = html.replace(bodyRegExp, match => body.join('') + match); + } else { + // Append scripts to the end of the file if no <body> element exists: + html += body.join(''); + } + } + + if (head.length) { + // Create a head tag if none exists + if (!headRegExp.test(html)) { + if (!htmlRegExp.test(html)) { + html = '<head></head>' + html; + } else { + html = html.replace(htmlRegExp, match => match + '<head></head>'); + } + } + + // Append assets to head element + html = html.replace(headRegExp, match => head.join('') + match); + } + + // Inject manifest into the opening html tag + if (assets.manifest) { + html = html.replace(/(<html[^>]*)(>)/i, (match, start, end) => { + // Append the manifest only if no manifest was specified + if (/\smanifest\s*=/.test(match)) { + return match; + } + return start + ' manifest="' + assets.manifest + '"' + end; + }); + } + return html; + } + + /** + * Appends a cache busting hash + */ + appendHash (url, hash) { + if (!url) { + return url; + } + return url + (url.indexOf('?') === -1 ? '?' : '&') + hash; + } + + /** + * Turn a tag definition into a html string + */ + createHtmlTag (tagDefinition) { + const attributes = Object.keys(tagDefinition.attributes || {}) + .filter(attributeName => tagDefinition.attributes[attributeName] !== false) + .map(attributeName => { + if (tagDefinition.attributes[attributeName] === true) { + return attributeName; + } + return attributeName + '="' + tagDefinition.attributes[attributeName] + '"'; + }); + // Backport of 3.x void tag definition + const voidTag = tagDefinition.voidTag !== undefined ? tagDefinition.voidTag : !tagDefinition.closeTag; + const selfClosingTag = tagDefinition.voidTag !== undefined ? tagDefinition.voidTag && this.options.xhtml : tagDefinition.selfClosingTag; + return '<' + [tagDefinition.tagName].concat(attributes).join(' ') + (selfClosingTag ? '/' : '') + '>' + + (tagDefinition.innerHTML || '') + + (voidTag ? '' : '</' + tagDefinition.tagName + '>'); + } + + /** + * Helper to return the absolute template path with a fallback loader + */ + getFullTemplatePath (template, context) { + // If the template doesn't use a loader use the lodash template loader + if (template.indexOf('!') === -1) { + template = require.resolve('./lib/loader.js') + '!' + path.resolve(context, template); + } + // Resolve template path + return template.replace( + /([!])([^/\\][^!?]+|[^/\\!?])($|\?[^!?\n]+$)/, + (match, prefix, filepath, postfix) => prefix + path.resolve(filepath) + postfix); + } + + /** + * Helper to return a sorted unique array of all asset files out of the + * asset object + */ + getAssetFiles (assets) { + const files = _.uniq(Object.keys(assets).filter(assetType => assetType !== 'chunks' && assets[assetType]).reduce((files, assetType) => files.concat(assets[assetType]), [])); + files.sort(); + return files; + } + + /** + * Helper to promisify compilation.applyPluginsAsyncWaterfall that returns + * a function that helps to merge given plugin arguments with processed ones + */ + applyPluginsAsyncWaterfall (compilation) { + if (compilation.hooks) { + return (eventName, requiresResult, pluginArgs) => { + const ccEventName = trainCaseToCamelCase(eventName); + if (!compilation.hooks[ccEventName]) { + compilation.errors.push( + new Error('No hook found for ' + eventName) + ); + } + + return compilation.hooks[ccEventName].promise(pluginArgs); + }; + } + + // Before Webpack 4 + const promisedApplyPluginsAsyncWaterfall = function (name, init) { + return new Promise((resolve, reject) => { + const callback = function (err, result) { + if (err) { + return reject(err); + } + resolve(result); + }; + compilation.applyPluginsAsyncWaterfall(name, init, callback); + }); + }; + + return (eventName, requiresResult, pluginArgs) => promisedApplyPluginsAsyncWaterfall(eventName, pluginArgs) + .then(result => { + if (requiresResult && !result) { + compilation.warnings.push( + new Error('Using ' + eventName + ' without returning a result is deprecated.') + ); + } + return _.extend(pluginArgs, result); + }); + } +} + +/** + * Takes a string in train case and transforms it to camel case + * + * Example: 'hello-my-world' to 'helloMyWorld' + * + * @param {string} word + */ +function trainCaseToCamelCase (word) { + return word.replace(/-([\w])/g, (match, p1) => p1.toUpperCase()); +} + +/** + * The default for options.templateParameter + * Generate the template parameters + */ +function templateParametersGenerator (compilation, assets, options) { + return { + compilation: compilation, + webpack: compilation.getStats().toJson(), + webpackConfig: compilation.options, + htmlWebpackPlugin: { + files: assets, + options: options + } + }; +} + +module.exports = HtmlWebpackPlugin; diff --git a/node_modules/vuepress-html-webpack-plugin/lib/chunksorter.js b/node_modules/vuepress-html-webpack-plugin/lib/chunksorter.js new file mode 100644 index 00000000..36b5c9a9 --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/lib/chunksorter.js @@ -0,0 +1,139 @@ +'use strict'; + +const toposort = require('toposort'); +const _ = require('lodash'); + +/** + Sorts dependencies between chunks by their "parents" attribute. + + This function sorts chunks based on their dependencies with each other. + The parent relation between chunks as generated by Webpack for each chunk + is used to define a directed (and hopefully acyclic) graph, which is then + topologically sorted in order to retrieve the correct order in which + chunks need to be embedded into HTML. A directed edge in this graph is + describing a "is parent of" relationship from a chunk to another (distinct) + chunk. Thus topological sorting orders chunks from bottom-layer chunks to + highest level chunks that use the lower-level chunks. + + @param {Array} chunks an array of chunks as generated by the html-webpack-plugin. + - For webpack < 4, It is assumed that each entry contains at least the properties + "id" (containing the chunk id) and "parents" (array containing the ids of the + parent chunks). + - For webpack 4+ the see the chunkGroups param for parent-child relationships + + @param {Array} chunks an array of ChunkGroups that has a getParents method. + Each ChunkGroup contains a list of chunks in order. + + @return {Array} A topologically sorted version of the input chunks +*/ +module.exports.dependency = (chunks, options, compilation) => { + const chunkGroups = compilation.chunkGroups; + if (!chunks) { + return chunks; + } + + // We build a map (chunk-id -> chunk) for faster access during graph building. + const nodeMap = {}; + + chunks.forEach(chunk => { + nodeMap[chunk.id] = chunk; + }); + + // Next, we add an edge for each parent relationship into the graph + let edges = []; + + if (chunkGroups) { + // Add an edge for each parent (parent -> child) + edges = chunkGroups.reduce((result, chunkGroup) => result.concat( + Array.from(chunkGroup.parentsIterable, parentGroup => [parentGroup, chunkGroup]) + ), []); + const sortedGroups = toposort.array(chunkGroups, edges); + // flatten chunkGroup into chunks + const sortedChunks = sortedGroups + .reduce((result, chunkGroup) => result.concat(chunkGroup.chunks), []) + .map(chunk => // use the chunk from the list passed in, since it may be a filtered list + nodeMap[chunk.id]) + .filter((chunk, index, self) => { + // make sure exists (ie excluded chunks not in nodeMap) + const exists = !!chunk; + // make sure we have a unique list + const unique = self.indexOf(chunk) === index; + return exists && unique; + }); + return sortedChunks; + } else { + // before webpack 4 there was no chunkGroups + chunks.forEach(chunk => { + if (chunk.parents) { + // Add an edge for each parent (parent -> child) + chunk.parents.forEach(parentId => { + // webpack2 chunk.parents are chunks instead of string id(s) + const parentChunk = _.isObject(parentId) ? parentId : nodeMap[parentId]; + // If the parent chunk does not exist (e.g. because of an excluded chunk) + // we ignore that parent + if (parentChunk) { + edges.push([parentChunk, chunk]); + } + }); + } + }); + // We now perform a topological sorting on the input chunks and built edges + return toposort.array(chunks, edges); + } +}; + +/** + * Sorts the chunks based on the chunk id. + * + * @param {Array} chunks the list of chunks to sort + * @return {Array} The sorted list of chunks + */ +module.exports.id = chunks => chunks.sort(function orderEntryLast (a, b) { + if (a.entry !== b.entry) { + return b.entry ? 1 : -1; + } else { + return b.id - a.id; + } +}); + +/** + * Performs identity mapping (no-sort). + * @param {Array} chunks the chunks to sort + * @return {Array} The sorted chunks + */ +module.exports.none = chunks => chunks; + +/** + * Sort manually by the chunks + * @param {Array} chunks the chunks to sort + * @return {Array} The sorted chunks + */ +module.exports.manual = (chunks, options) => { + const specifyChunks = options.chunks; + const chunksResult = []; + let filterResult = []; + if (Array.isArray(specifyChunks)) { + for (var i = 0; i < specifyChunks.length; i++) { + filterResult = chunks.filter(chunk => { + if (chunk.names[0] && chunk.names[0] === specifyChunks[i]) { + return true; + } + return false; + }); + filterResult.length > 0 && chunksResult.push(filterResult[0]); + } + } + return chunksResult; +}; + +/** + * Defines the default sorter. + */ +module.exports.auto = module.exports.id; + +// In webpack 2 the ids have been flipped. +// Therefore the id sort doesn't work the same way as it did for webpack 1 +// Luckily the dependency sort is working as expected +if (Number(require('webpack/package.json').version.split('.')[0]) > 1) { + module.exports.auto = module.exports.dependency; +} diff --git a/node_modules/vuepress-html-webpack-plugin/lib/compiler.js b/node_modules/vuepress-html-webpack-plugin/lib/compiler.js new file mode 100644 index 00000000..d5c91b6c --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/lib/compiler.js @@ -0,0 +1,125 @@ +/* + * This file uses webpack to compile a template with a child compiler. + * + * [TEMPLATE] -> [JAVASCRIPT] + * + */ +'use strict'; +const path = require('path'); +const NodeTemplatePlugin = require('webpack/lib/node/NodeTemplatePlugin'); +const NodeTargetPlugin = require('webpack/lib/node/NodeTargetPlugin'); +const LoaderTargetPlugin = require('webpack/lib/LoaderTargetPlugin'); +const LibraryTemplatePlugin = require('webpack/lib/LibraryTemplatePlugin'); +const SingleEntryPlugin = require('webpack/lib/SingleEntryPlugin'); + +/** + * Compiles the template into a nodejs factory, adds its to the compilation.assets + * and returns a promise of the result asset object. + * + * @param template relative path to the template file + * @param context path context + * @param outputFilename the file name + * @param compilation The webpack compilation object + * + * Returns an object: + * { + * hash: {String} - Base64 hash of the file + * content: {String} - Javascript executable code of the template + * } + * + */ +module.exports.compileTemplate = function compileTemplate (template, context, outputFilename, compilation) { + // The entry file is just an empty helper as the dynamic template + // require is added in "loader.js" + const outputOptions = { + filename: outputFilename, + publicPath: compilation.outputOptions.publicPath + }; + // Store the result of the parent compilation before we start the child compilation + const assetsBeforeCompilation = Object.assign({}, compilation.assets[outputOptions.filename]); + // Create an additional child compiler which takes the template + // and turns it into an Node.JS html factory. + // This allows us to use loaders during the compilation + const compilerName = getCompilerName(context, outputFilename); + const childCompiler = compilation.createChildCompiler(compilerName, outputOptions); + childCompiler.context = context; + new NodeTemplatePlugin(outputOptions).apply(childCompiler); + new NodeTargetPlugin().apply(childCompiler); + new LibraryTemplatePlugin('HTML_WEBPACK_PLUGIN_RESULT', 'var').apply(childCompiler); + + // Using undefined as name for the SingleEntryPlugin causes a unexpected output as described in + // https://github.com/jantimon/html-webpack-plugin/issues/895 + // Using a string as a name for the SingleEntryPlugin causes problems with HMR as described in + // https://github.com/jantimon/html-webpack-plugin/issues/900 + // Until the HMR issue is fixed we keep the ugly output: + new SingleEntryPlugin(this.context, template, undefined).apply(childCompiler); + + new LoaderTargetPlugin('node').apply(childCompiler); + + // Fix for "Uncaught TypeError: __webpack_require__(...) is not a function" + // Hot module replacement requires that every child compiler has its own + // cache. @see https://github.com/ampedandwired/html-webpack-plugin/pull/179 + + // Backwards compatible version of: childCompiler.hooks.compilation + (childCompiler.hooks ? childCompiler.hooks.compilation.tap.bind(childCompiler.hooks.compilation, 'HtmlWebpackPlugin') : childCompiler.plugin.bind(childCompiler, 'compilation'))(compilation => { + if (compilation.cache) { + if (!compilation.cache[compilerName]) { + compilation.cache[compilerName] = {}; + } + compilation.cache = compilation.cache[compilerName]; + } + }); + + // Compile and return a promise + return new Promise((resolve, reject) => { + childCompiler.runAsChild((err, entries, childCompilation) => { + // Resolve / reject the promise + if (childCompilation && childCompilation.errors && childCompilation.errors.length) { + const errorDetails = childCompilation.errors.map(error => error.message + (error.error ? ':\n' + error.error : '')).join('\n'); + reject(new Error('Child compilation failed:\n' + errorDetails)); + } else if (err) { + reject(err); + } else { + // Replace [hash] placeholders in filename + // In webpack 4 the plugin interface changed, so check for available fns + const outputName = compilation.mainTemplate.getAssetPath + ? compilation.mainTemplate.hooks.assetPath.call(outputOptions.filename, { + hash: childCompilation.hash, + chunk: entries[0] + }) + : compilation.mainTemplate.applyPluginsWaterfall( + 'asset-path', + outputOptions.filename, + { + hash: childCompilation.hash, + chunk: entries[0] + }); + + // Restore the parent compilation to the state like it + // was before the child compilation + compilation.assets[outputName] = assetsBeforeCompilation[outputName]; + if (assetsBeforeCompilation[outputName] === undefined) { + // If it wasn't there - delete it + delete compilation.assets[outputName]; + } + resolve({ + // Hash of the template entry point + hash: entries[0].hash, + // Output name + outputName: outputName, + // Compiled code + content: childCompilation.assets[outputName].source() + }); + } + }); + }); +}; + +/** + * Returns the child compiler name e.g. 'html-webpack-plugin for "index.html"' + */ +function getCompilerName (context, filename) { + const absolutePath = path.resolve(context, filename); + const relativePath = path.relative(context, absolutePath); + return 'html-webpack-plugin for "' + (absolutePath.length < relativePath.length ? absolutePath : relativePath) + '"'; +} diff --git a/node_modules/vuepress-html-webpack-plugin/lib/errors.js b/node_modules/vuepress-html-webpack-plugin/lib/errors.js new file mode 100644 index 00000000..2b946dad --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/lib/errors.js @@ -0,0 +1,23 @@ +'use strict'; +const PrettyError = require('pretty-error'); +const prettyError = new PrettyError(); +prettyError.withoutColors(); +prettyError.skipPackage(['html-plugin-evaluation']); +prettyError.skipNodeFiles(); +prettyError.skip(function (traceLine) { + return traceLine.path === 'html-plugin-evaluation'; +}); + +module.exports = function (err, context) { + return { + toHtml: function () { + return 'Html Webpack Plugin:\n<pre>\n' + this.toString() + '</pre>'; + }, + toJsonHtml: function () { + return JSON.stringify(this.toHtml()); + }, + toString: function () { + return prettyError.render(err).replace(/webpack:\/\/\/\./g, context); + } + }; +}; diff --git a/node_modules/vuepress-html-webpack-plugin/lib/loader.js b/node_modules/vuepress-html-webpack-plugin/lib/loader.js new file mode 100644 index 00000000..c1062d1f --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/lib/loader.js @@ -0,0 +1,35 @@ +/* This loader renders the template with underscore if no other loader was found */ +'use strict'; + +const _ = require('lodash'); +const loaderUtils = require('loader-utils'); + +module.exports = function (source) { + if (this.cacheable) { + this.cacheable(); + } + const allLoadersButThisOne = this.loaders.filter(function (loader) { + // Loader API changed from `loader.module` to `loader.normal` in Webpack 2. + return (loader.module || loader.normal) !== module.exports; + }); + // This loader shouldn't kick in if there is any other loader + if (allLoadersButThisOne.length > 0) { + return source; + } + // Skip .js files + if (/\.js$/.test(this.resourcePath)) { + return source; + } + + // The following part renders the tempalte with lodash as aminimalistic loader + // + // Get templating options + const options = this.query !== '' ? loaderUtils.parseQuery(this.query) : {}; + const template = _.template(source, _.defaults(options, { variable: 'data' })); + // Require !!lodash - using !! will disable all loaders (e.g. babel) + return 'var _ = require(' + loaderUtils.stringifyRequest(this, '!!' + require.resolve('lodash')) + ');' + + 'module.exports = function (templateParams) { with(templateParams) {' + + // Execute the lodash template + 'return (' + template.source + ')();' + + '}}'; +}; diff --git a/node_modules/vuepress-html-webpack-plugin/node_modules/.bin/html-minifier b/node_modules/vuepress-html-webpack-plugin/node_modules/.bin/html-minifier new file mode 120000 index 00000000..82bf699e --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/node_modules/.bin/html-minifier @@ -0,0 +1 @@ +../../../html-minifier/cli.js
\ No newline at end of file diff --git a/node_modules/vuepress-html-webpack-plugin/node_modules/.bin/webpack b/node_modules/vuepress-html-webpack-plugin/node_modules/.bin/webpack new file mode 120000 index 00000000..8a1900f6 --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/node_modules/.bin/webpack @@ -0,0 +1 @@ +../../../webpack/bin/webpack.js
\ No newline at end of file diff --git a/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/LICENSE b/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/LICENSE new file mode 100644 index 00000000..c4bdf1b8 --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2012 - 2015 Tobias Koppers + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/README.md b/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/README.md new file mode 100644 index 00000000..305fa902 --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/README.md @@ -0,0 +1,217 @@ +# loader-utils + +## Methods + +### `getLoaderConfig` + +Recommended way to retrieve the loader config: + +```javascript +// inside your loader +config = loaderUtils.getLoaderConfig(this, "myLoader"); +``` + +Tries to read the loader config from the `webpack.config.js` under the given property name (`"myLoader"` in this case) and merges the result with the loader query. For example, if your `webpack.config.js` had this property... + +```javascript +cheesecakeLoader: { + type: "delicious", + slices: 4 +} +``` + +...and your loader was called with `?slices=8`, `getLoaderConfig(this, "cheesecakeLoader")` would return + +```javascript +{ + type: "delicious", + slices: 8 +} +``` + +It is recommended that you use the camelCased loader name as your default config property name. + +### `parseQuery` + +``` javascript +var query = loaderUtils.parseQuery(this.query); +assert(typeof query == "object"); +if(query.flag) + // ... +``` + +``` text +null -> {} +? -> {} +?flag -> { flag: true } +?+flag -> { flag: true } +?-flag -> { flag: false } +?xyz=test -> { xyz: "test" } +?xyz[]=a -> { xyz: ["a"] } +?flag1&flag2 -> { flag1: true, flag2: true } +?+flag1,-flag2 -> { flag1: true, flag2: false } +?xyz[]=a,xyz[]=b -> { xyz: ["a", "b"] } +?a%2C%26b=c%2C%26d -> { "a,&b": "c,&d" } +?{json:5,data:{a:1}} -> { json: 5, data: { a: 1 } } +``` + +### `stringifyRequest` + +Turns a request into a string that can be used inside `require()` or `import` while avoiding absolute paths. +Use it instead of `JSON.stringify(...)` if you're generating code inside a loader. + +**Why is this necessary?** Since webpack calculates the hash before module paths are translated into module ids, we must avoid absolute paths to ensure +consistent hashes across different compilations. + +This function: + +- resolves absolute requests into relative requests if the request and the module are on the same hard drive +- replaces `\` with `/` if the request and the module are on the same hard drive +- won't change the path at all if the request and the module are on different hard drives +- applies `JSON.stringify` to the result + +```javascript +loaderUtils.stringifyRequest(this, "./test.js"); +// "\"./test.js\"" + +loaderUtils.stringifyRequest(this, ".\\test.js"); +// "\"./test.js\"" + +loaderUtils.stringifyRequest(this, "test"); +// "\"test\"" + +loaderUtils.stringifyRequest(this, "test/lib/index.js"); +// "\"test/lib/index.js\"" + +loaderUtils.stringifyRequest(this, "otherLoader?andConfig!test?someConfig"); +// "\"otherLoader?andConfig!test?someConfig\"" + +loaderUtils.stringifyRequest(this, require.resolve("test")); +// "\"../node_modules/some-loader/lib/test.js\"" + +loaderUtils.stringifyRequest(this, "C:\\module\\test.js"); +// "\"../../test.js\"" (on Windows, in case the module and the request are on the same drive) + +loaderUtils.stringifyRequest(this, "C:\\module\\test.js"); +// "\"C:\\module\\test.js\"" (on Windows, in case the module and the request are on different drives) + +loaderUtils.stringifyRequest(this, "\\\\network-drive\\test.js"); +// "\"\\\\network-drive\\\\test.js\"" (on Windows, in case the module and the request are on different drives) +``` + +### `urlToRequest` + +Converts some resource URL to a webpack module request. + +```javascript +var url = "path/to/module.js"; +var request = loaderUtils.urlToRequest(url); // "./path/to/module.js" +``` + +#### Module URLs + +Any URL containing a `~` will be interpreted as a module request. Anything after the `~` will be considered the request path. + +```javascript +var url = "~path/to/module.js"; +var request = loaderUtils.urlToRequest(url); // "path/to/module.js" +``` + +#### Root-relative URLs + +URLs that are root-relative (start with `/`) can be resolved relative to some arbitrary path by using the `root` parameter: + +```javascript +var url = "/path/to/module.js"; +var root = "./root"; +var request = loaderUtils.urlToRequest(url, root); // "./root/path/to/module.js" +``` + +To convert a root-relative URL into a module URL, specify a `root` value that starts with `~`: + +```javascript +var url = "/path/to/module.js"; +var root = "~"; +var request = loaderUtils.urlToRequest(url, root); // "path/to/module.js" +``` + +### `interpolateName` + +Interpolates a filename template using multiple placeholders and/or a regular expression. +The template and regular expression are set as query params called `name` and `regExp` on the current loader's context. + +```javascript +var interpolatedName = loaderUtils.interpolateName(loaderContext, name, options); +``` + +The following tokens are replaced in the `name` parameter: + +* `[ext]` the extension of the resource +* `[name]` the basename of the resource +* `[path]` the path of the resource relative to the `context` query parameter or option. +* `[folder]` the folder of the resource is in. +* `[emoji]` a random emoji representation of `options.content` +* `[emoji:<length>]` same as above, but with a customizable number of emojis +* `[hash]` the hash of `options.content` (Buffer) (by default it's the hex digest of the md5 hash) +* `[<hashType>:hash:<digestType>:<length>]` optionally one can configure + * other `hashType`s, i. e. `sha1`, `md5`, `sha256`, `sha512` + * other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64` + * and `length` the length in chars +* `[N]` the N-th match obtained from matching the current file name against `options.regExp` + +Examples + +``` javascript +// loaderContext.resourcePath = "/app/js/javascript.js" +loaderUtils.interpolateName(loaderContext, "js/[hash].script.[ext]", { content: ... }); +// => js/9473fdd0d880a43c21b7778d34872157.script.js + +// loaderContext.resourcePath = "/app/page.html" +loaderUtils.interpolateName(loaderContext, "html-[hash:6].html", { content: ... }); +// => html-9473fd.html + +// loaderContext.resourcePath = "/app/flash.txt" +loaderUtils.interpolateName(loaderContext, "[hash]", { content: ... }); +// => c31e9820c001c9c4a86bce33ce43b679 + +// loaderContext.resourcePath = "/app/img/image.gif" +loaderUtils.interpolateName(loaderContext, "[emoji]", { content: ... }); +// => ๐ + +// loaderContext.resourcePath = "/app/img/image.gif" +loaderUtils.interpolateName(loaderContext, "[emoji:4]", { content: ... }); +// => ๐๐ข๐ค๐ + +// loaderContext.resourcePath = "/app/img/image.png" +loaderUtils.interpolateName(loaderContext, "[sha512:hash:base64:7].[ext]", { content: ... }); +// => 2BKDTjl.png +// use sha512 hash instead of md5 and with only 7 chars of base64 + +// loaderContext.resourcePath = "/app/img/myself.png" +// loaderContext.query.name = +loaderUtils.interpolateName(loaderContext, "picture.png"); +// => picture.png + +// loaderContext.resourcePath = "/app/dir/file.png" +loaderUtils.interpolateName(loaderContext, "[path][name].[ext]?[hash]", { content: ... }); +// => /app/dir/file.png?9473fdd0d880a43c21b7778d34872157 + +// loaderContext.resourcePath = "/app/js/page-home.js" +loaderUtils.interpolateName(loaderContext, "script-[1].[ext]", { regExp: "page-(.*)\\.js", content: ... }); +// => script-home.js +``` + +### `getHashDigest` + +``` javascript +var digestString = loaderUtils.getHashDigest(buffer, hashType, digestType, maxLength); +``` + +* `buffer` the content that should be hashed +* `hashType` one of `sha1`, `md5`, `sha256`, `sha512` or any other node.js supported hash type +* `digestType` one of `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64` +* `maxLength` the maximum length in chars + +## License + +MIT (http://www.opensource.org/licenses/mit-license.php) diff --git a/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/index.js b/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/index.js new file mode 100644 index 00000000..49e1d18f --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/index.js @@ -0,0 +1,331 @@ +var JSON5 = require("json5"); +var path = require("path"); +var util = require("util"); +var os = require("os"); +var assign = require("object-assign"); +var emojiRegex = /[\uD800-\uDFFF]./; +var emojiList = require("emojis-list").filter(function(emoji) { + return emojiRegex.test(emoji) +}); +var matchAbsolutePath = /^\/|^[A-Z]:[/\\]|^\\\\/i; // node 0.10 does not support path.isAbsolute() +var matchAbsoluteWin32Path = /^[A-Z]:[/\\]|^\\\\/i; +var matchRelativePath = /^\.\.?[/\\]/; + +var baseEncodeTables = { + 26: "abcdefghijklmnopqrstuvwxyz", + 32: "123456789abcdefghjkmnpqrstuvwxyz", // no 0lio + 36: "0123456789abcdefghijklmnopqrstuvwxyz", + 49: "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", // no lIO + 52: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + 58: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", // no 0lIO + 62: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + 64: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_" +}; +var emojiCache = {}; +var parseQueryDeprecationWarning = util.deprecate(function() {}, + "loaderUtils.parseQuery() received a non-string value which can be problematic, " + + "see https://github.com/webpack/loader-utils/issues/56" + os.EOL + + "parseQuery() will be replaced with getOptions() in the next major version of loader-utils." +); + +function encodeStringToEmoji(content, length) { + if (emojiCache[content]) return emojiCache[content]; + length = length || 1; + var emojis = []; + do { + var index = Math.floor(Math.random() * emojiList.length); + emojis.push(emojiList[index]); + emojiList.splice(index, 1); + } while (--length > 0); + var emojiEncoding = emojis.join(''); + emojiCache[content] = emojiEncoding; + return emojiEncoding; +} + +function encodeBufferToBase(buffer, base) { + var encodeTable = baseEncodeTables[base]; + if (!encodeTable) throw new Error("Unknown encoding base" + base); + + var readLength = buffer.length; + + var Big = require('big.js'); + Big.RM = Big.DP = 0; + var b = new Big(0); + for (var i = readLength - 1; i >= 0; i--) { + b = b.times(256).plus(buffer[i]); + } + + var output = ""; + while (b.gt(0)) { + output = encodeTable[b.mod(base)] + output; + b = b.div(base); + } + + Big.DP = 20; + Big.RM = 1; + + return output; +} + +exports.parseQuery = function parseQuery(query) { + var specialValues = { + 'null': null, + 'true': true, + 'false': false + }; + if(!query) return {}; + if(typeof query !== "string") { + parseQueryDeprecationWarning(); + return query; + } + if(query.substr(0, 1) !== "?") + throw new Error("a valid query string passed to parseQuery should begin with '?'"); + query = query.substr(1); + var queryLength = query.length; + if(query.substr(0, 1) === "{" && query.substr(-1) === "}") { + return JSON5.parse(query); + } + var queryArgs = query.split(/[,\&]/g); + var result = {}; + queryArgs.forEach(function(arg) { + var idx = arg.indexOf("="); + if(idx >= 0) { + var name = arg.substr(0, idx); + var value = decodeURIComponent(arg.substr(idx+1)); + if (specialValues.hasOwnProperty(value)) { + value = specialValues[value]; + } + if(name.substr(-2) === "[]") { + name = decodeURIComponent(name.substr(0, name.length-2)); + if(!Array.isArray(result[name])) + result[name] = []; + result[name].push(value); + } else { + name = decodeURIComponent(name); + result[name] = value; + } + } else { + if(arg.substr(0, 1) === "-") { + result[decodeURIComponent(arg.substr(1))] = false; + } else if(arg.substr(0, 1) === "+") { + result[decodeURIComponent(arg.substr(1))] = true; + } else { + result[decodeURIComponent(arg)] = true; + } + } + }); + return result; +}; + +exports.getLoaderConfig = function(loaderContext, defaultConfigKey) { + var query = exports.parseQuery(loaderContext.query); + var configKey = query.config || defaultConfigKey; + if (configKey) { + var config = loaderContext.options[configKey] || {}; + delete query.config; + return assign({}, config, query); + } + + return query; +}; + +exports.stringifyRequest = function(loaderContext, request) { + var splitted = request.split("!"); + var context = loaderContext.context || (loaderContext.options && loaderContext.options.context); + return JSON.stringify(splitted.map(function(part) { + // First, separate singlePath from query, because the query might contain paths again + var splittedPart = part.match(/^(.*?)(\?.*)/); + var singlePath = splittedPart ? splittedPart[1] : part; + var query = splittedPart ? splittedPart[2] : ""; + if(matchAbsolutePath.test(singlePath) && context) { + singlePath = path.relative(context, singlePath); + if(matchAbsolutePath.test(singlePath)) { + // If singlePath still matches an absolute path, singlePath was on a different drive than context. + // In this case, we leave the path platform-specific without replacing any separators. + // @see https://github.com/webpack/loader-utils/pull/14 + return singlePath + query; + } + if(matchRelativePath.test(singlePath) === false) { + // Ensure that the relative path starts at least with ./ otherwise it would be a request into the modules directory (like node_modules). + singlePath = "./" + singlePath; + } + } + return singlePath.replace(/\\/g, "/") + query; + }).join("!")); +}; + +function dotRequest(obj) { + return obj.request; +} + +exports.getRemainingRequest = function(loaderContext) { + if(loaderContext.remainingRequest) + return loaderContext.remainingRequest; + var request = loaderContext.loaders.slice(loaderContext.loaderIndex+1).map(dotRequest).concat([loaderContext.resource]); + return request.join("!"); +}; + +exports.getCurrentRequest = function(loaderContext) { + if(loaderContext.currentRequest) + return loaderContext.currentRequest; + var request = loaderContext.loaders.slice(loaderContext.loaderIndex).map(dotRequest).concat([loaderContext.resource]); + return request.join("!"); +}; + +exports.isUrlRequest = function(url, root) { + // An URL is not an request if + // 1. it's a Data Url + // 2. it's an absolute url or and protocol-relative + // 3. it's some kind of url for a template + if(/^data:|^chrome-extension:|^(https?:)?\/\/|^[\{\}\[\]#*;,'ยง\$%&\(=?`ยด\^ยฐ<>]/.test(url)) return false; + // 4. It's also not an request if root isn't set and it's a root-relative url + if((root === undefined || root === false) && /^\//.test(url)) return false; + return true; +}; + +exports.urlToRequest = function(url, root) { + var moduleRequestRegex = /^[^?]*~/; + var request; + + if(matchAbsoluteWin32Path.test(url)) { + // absolute windows path, keep it + request = url; + } else if(root !== undefined && root !== false && /^\//.test(url)) { + // if root is set and the url is root-relative + switch(typeof root) { + // 1. root is a string: root is prefixed to the url + case "string": + // special case: `~` roots convert to module request + if (moduleRequestRegex.test(root)) { + request = root.replace(/([^~\/])$/, "$1/") + url.slice(1); + } else { + request = root + url; + } + break; + // 2. root is `true`: absolute paths are allowed + // *nix only, windows-style absolute paths are always allowed as they doesn't start with a `/` + case "boolean": + request = url; + break; + default: + throw new Error("Unexpected parameters to loader-utils 'urlToRequest': url = " + url + ", root = " + root + "."); + } + } else if(/^\.\.?\//.test(url)) { + // A relative url stays + request = url; + } else { + // every other url is threaded like a relative url + request = "./" + url; + } + + // A `~` makes the url an module + if (moduleRequestRegex.test(request)) { + request = request.replace(moduleRequestRegex, ""); + } + + return request; +}; + +exports.parseString = function parseString(str) { + try { + if(str[0] === '"') return JSON.parse(str); + if(str[0] === "'" && str.substr(str.length - 1) === "'") { + return parseString(str.replace(/\\.|"/g, function(x) { + if(x === '"') return '\\"'; + return x; + }).replace(/^'|'$/g, '"')); + } + return JSON.parse('"' + str + '"'); + } catch(e) { + return str; + } +}; + +exports.getHashDigest = function getHashDigest(buffer, hashType, digestType, maxLength) { + hashType = hashType || "md5"; + maxLength = maxLength || 9999; + var hash = require("crypto").createHash(hashType); + hash.update(buffer); + if (digestType === "base26" || digestType === "base32" || digestType === "base36" || + digestType === "base49" || digestType === "base52" || digestType === "base58" || + digestType === "base62" || digestType === "base64") { + return encodeBufferToBase(hash.digest(), digestType.substr(4)).substr(0, maxLength); + } else { + return hash.digest(digestType || "hex").substr(0, maxLength); + } +}; + +exports.interpolateName = function interpolateName(loaderContext, name, options) { + var filename; + if (typeof name === "function") { + filename = name(loaderContext.resourcePath); + } else { + filename = name || "[hash].[ext]"; + } + var context = options.context; + var content = options.content; + var regExp = options.regExp; + var ext = "bin"; + var basename = "file"; + var directory = ""; + var folder = ""; + if(loaderContext.resourcePath) { + var resourcePath = loaderContext.resourcePath; + var idx = resourcePath.lastIndexOf("."); + var i = resourcePath.lastIndexOf("\\"); + var j = resourcePath.lastIndexOf("/"); + var p = i < 0 ? j : j < 0 ? i : i < j ? i : j; + if(idx >= 0) { + ext = resourcePath.substr(idx+1); + resourcePath = resourcePath.substr(0, idx); + } + if(p >= 0) { + basename = resourcePath.substr(p+1); + resourcePath = resourcePath.substr(0, p+1); + } + if (typeof context !== 'undefined') { + directory = path.relative(context, resourcePath + "_").replace(/\\/g, "/").replace(/\.\.(\/)?/g, "_$1"); + directory = directory.substr(0, directory.length-1); + } + else { + directory = resourcePath.replace(/\\/g, "/").replace(/\.\.(\/)?/g, "_$1"); + } + if (directory.length === 1) { + directory = ""; + } else if (directory.length > 1) { + folder = path.basename(directory); + } + } + var url = filename; + if(content) { + // Match hash template + url = url.replace(/\[(?:(\w+):)?hash(?::([a-z]+\d*))?(?::(\d+))?\]/ig, function() { + return exports.getHashDigest(content, arguments[1], arguments[2], parseInt(arguments[3], 10)); + }).replace(/\[emoji(?::(\d+))?\]/ig, function() { + return encodeStringToEmoji(content, arguments[1]); + }); + } + url = url.replace(/\[ext\]/ig, function() { + return ext; + }).replace(/\[name\]/ig, function() { + return basename; + }).replace(/\[path\]/ig, function() { + return directory; + }).replace(/\[folder\]/ig, function() { + return folder; + }); + if(regExp && loaderContext.resourcePath) { + var re = new RegExp(regExp); + var match = loaderContext.resourcePath.match(re); + if(match) { + for (var i = 0; i < match.length; i++) { + var re = new RegExp("\\[" + i + "\\]", "ig"); + url = url.replace(re, match[i]); + } + } + } + if(typeof loaderContext.options === "object" && typeof loaderContext.options.customInterpolateName === "function") { + url = loaderContext.options.customInterpolateName.call(loaderContext, url, name, options); + } + return url; +}; diff --git a/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/node_modules/.bin/json5 b/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/node_modules/.bin/json5 new file mode 120000 index 00000000..09cacab1 --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/node_modules/.bin/json5 @@ -0,0 +1 @@ +../../../../../json5/lib/cli.js
\ No newline at end of file diff --git a/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/package.json b/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/package.json new file mode 100644 index 00000000..699cb028 --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/node_modules/loader-utils/package.json @@ -0,0 +1,31 @@ +{ + "name": "loader-utils", + "version": "0.2.17", + "author": "Tobias Koppers @sokra", + "description": "utils for webpack loaders", + "dependencies": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0", + "object-assign": "^4.0.1" + }, + "scripts": { + "test": "mocha", + "travis": "npm run cover -- --report lcovonly", + "cover": "istanbul cover -x *.runtime.js node_modules/mocha/bin/_mocha", + "publish-patch": "mocha && npm version patch && git push && git push --tags && npm publish" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/webpack/loader-utils.git" + }, + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.3.14", + "mocha": "^1.21.4" + }, + "files": [ + "index.js" + ] +} diff --git a/node_modules/vuepress-html-webpack-plugin/package.json b/node_modules/vuepress-html-webpack-plugin/package.json new file mode 100644 index 00000000..e0587227 --- /dev/null +++ b/node_modules/vuepress-html-webpack-plugin/package.json @@ -0,0 +1,77 @@ +{ + "name": "vuepress-html-webpack-plugin", + "version": "3.2.0", + "license": "MIT", + "description": "Simplifies creation of HTML files to serve your webpack bundles", + "author": "Charles Blaxland <charles.blaxland@gmail.com> (https://github.com/ampedandwired)", + "main": "index.js", + "files": [ + "lib/", + "index.js", + "default_index.ejs" + ], + "scripts": { + "pretest": "semistandard", + "commit": "git-cz", + "build-examples": "node examples/build-examples.js", + "test": "jasmine", + "release": "standard-version" + }, + "semistandard": { + "ignore": [ + "examples/*/dist/**/*.*" + ] + }, + "devDependencies": { + "appcache-webpack-plugin": "^1.3.0", + "commitizen": "2.9.6", + "css-loader": "^0.26.1", + "cz-conventional-changelog": "2.1.0", + "dir-compare": "1.3.0", + "es6-promise": "^4.0.5", + "extract-text-webpack-plugin": "^1.0.1", + "file-loader": "^0.9.0", + "html-loader": "^0.4.4", + "jade": "^1.11.0", + "jade-loader": "^0.8.0", + "jasmine": "^2.5.2", + "jasmine-diff-matchers": "^2.0.0", + "rimraf": "^2.5.4", + "semistandard": "8.0.0", + "standard-version": "^4.3.0", + "style-loader": "^0.13.1", + "underscore-template-loader": "^0.7.3", + "url-loader": "^0.5.7", + "webpack": "^1.14.0", + "webpack-recompilation-simulator": "^1.3.0" + }, + "dependencies": { + "html-minifier": "^3.2.3", + "loader-utils": "^0.2.16", + "lodash": "^4.17.3", + "pretty-error": "^2.0.2", + "tapable": "^1.0.0", + "toposort": "^1.0.0", + "util.promisify": "1.0.0" + }, + "peerDependencies": { + "webpack": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" + }, + "keywords": [ + "webpack", + "plugin", + "html", + "html-webpack-plugin" + ], + "bugs": "https://github.com/jantimon/html-webpack-plugin/issues", + "homepage": "https://github.com/jantimon/html-webpack-plugin", + "repository": "https://github.com/jantimon/html-webpack-plugin.git", + "engines": { + "node": ">=6.9" + }, + "config": { + "commitizen": { + "path": "./node_modules/cz-conventional-changelog" + } + } +} |
