diff --git a/README.md b/README.md index 891a098..f9c3f4a 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,6 @@ Allowed values are as follows: - `template`: Path to the template. Supports loaders e.g. `html!./index.html`. - `inject`: `true | 'head' | 'body' | false` Inject all assets into the given `template` or `templateContent` - When passing `true` or `'body'` all javascript resources will be placed at the bottom of the body element. `'head'` will place the scripts in the head element. - `favicon`: Adds the given favicon path to the output html. -- `manifest`: Adds the given manifest path to the output html. - `minify`: `{...} | false` Pass a [html-minifier](https://github.com/kangax/html-minifier#options-quick-reference) options object to minify the output. - `hash`: `true | false` if `true` then append a unique webpack compilation hash to all included scripts and css files. This is useful for cache busting. diff --git a/index.js b/index.js index 23dcad2..eaa47ac 100644 --- a/index.js +++ b/index.js @@ -53,7 +53,7 @@ HtmlWebpackPlugin.prototype.apply = function(compiler) { // Get assets var assets = self.htmlWebpackPluginAssets(compilation, chunks); Promise.resolve() - // Favicon and manifest + // Favicon .then(function() { if (self.options.favicon) { return self.addFileToAssets(self.options.favicon, compilation) @@ -61,12 +61,6 @@ HtmlWebpackPlugin.prototype.apply = function(compiler) { assets.favicon = faviconBasename; }); } - if (self.options.manifest) { - return self.addFileToAssets(self.options.manifest, compilation) - .then(function(manifestBasename){ - assets.manifest = manifestBasename; - }); - } }) // Wait for the compilation to finish .then(function() { diff --git a/package.json b/package.json index 8929732..f12d669 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ }, "homepage": "https://github.com/ampedandwired/html-webpack-plugin", "devDependencies": { + "appcache-webpack-plugin": "^0.2.0", "css-loader": "^0.15.4", "extract-text-webpack-plugin": "^0.8.2", "file-loader": "^0.8.4", diff --git a/spec/HtmlWebpackPluginSpec.js b/spec/HtmlWebpackPluginSpec.js index 986d6a5..d18f468 100644 --- a/spec/HtmlWebpackPluginSpec.js +++ b/spec/HtmlWebpackPluginSpec.js @@ -4,6 +4,7 @@ var fs = require('fs'); var webpack = require('webpack'); var rm_rf = require('rimraf'); var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin"); +var AppCachePlugin = require('appcache-webpack-plugin'); var HtmlWebpackPlugin = require('../index.js'); var OUTPUT_DIR = path.join(__dirname, '../dist'); @@ -583,11 +584,10 @@ describe('HtmlWebpackPlugin', function() { filename: 'index_bundle.js' }, plugins: [ - new HtmlWebpackPlugin({ - manifest: path.join(__dirname, 'fixtures/manifest.json') - }) + new AppCachePlugin({settings: ['prefer-online']}), + new HtmlWebpackPlugin() ] - }, [''], null, done); + }, [''], null, done); }); it('does not add a manifest if already present', function(done) { @@ -598,9 +598,9 @@ describe('HtmlWebpackPlugin', function() { filename: 'index_bundle.js' }, plugins: [ + new AppCachePlugin({settings: ['prefer-online']}), new HtmlWebpackPlugin({ template: path.join(__dirname, 'fixtures/plain.html'), - manifest: path.join(__dirname, 'fixtures/manifest.json') }) ] }, [''], null, done); diff --git a/spec/fixtures/manifest.json b/spec/fixtures/manifest.json deleted file mode 100644 index fd3e289..0000000 --- a/spec/fixtures/manifest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "HtmlWebpackPlugin" -}