Skip to content

Commit

Permalink
feat: deprecate cache in flavour of seed (#84)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: 'cache' was renamed 'seed'
  • Loading branch information
mastilver authored Sep 14, 2017
1 parent 7fcc482 commit a3db580
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
3 changes: 1 addition & 2 deletions lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ function ManifestPlugin(opts) {
fileName: 'manifest.json',
transformExtensions: /^(gz|map)$/i,
writeToFileEmit: false,
cache: null, // TODO: Remove `cache` in next major release in favour of `seed`.
seed: null,
filter: null,
map: null,
Expand All @@ -28,7 +27,7 @@ ManifestPlugin.prototype.getFileType = function(str) {

ManifestPlugin.prototype.apply = function(compiler) {
var outputName = this.opts.fileName;
var seed = this.opts.seed || this.opts.cache || {};
var seed = this.opts.seed || {};
var moduleAssets = {};

compiler.plugin("compilation", function (compilation) {
Expand Down
26 changes: 0 additions & 26 deletions spec/plugin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,32 +311,6 @@ describe('ManifestPlugin', function() {
});
});

it('still accepts cache parameter (deprecated)', function(done) {
var cache = {};
webpackCompile([{
context: __dirname,
entry: {
one: './fixtures/file.js'
}
}, {
context: __dirname,
entry: {
two: './fixtures/file-two.js'
}
}], {
manifestOptions: {
cache: cache
}
}, function(manifest) {
expect(manifest).toEqual({
'one.js': 'one.js',
'two.js': 'two.js'
});

done();
});
});

it('outputs a manifest of no-js file', function(done) {
webpackCompile({
context: __dirname,
Expand Down

0 comments on commit a3db580

Please sign in to comment.