Remove manifest option again and update test.

This commit is contained in:
Kees Kluskens 2015-09-06 15:18:20 +02:00 committed by Jan Nicklas
parent cfb7e3f01f
commit 0ede95051b
5 changed files with 7 additions and 16 deletions

View File

@ -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.

View File

@ -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() {

View File

@ -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",

View File

@ -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()
]
}, ['<html manifest="manifest.json">'], null, done);
}, ['<html manifest="manifest.appcache">'], 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')
})
]
}, ['<html lang="en" manifest="foo.appcache">'], null, done);

View File

@ -1,3 +0,0 @@
{
"name": "HtmlWebpackPlugin"
}