From a3db580ed7510d7bb8ccc9bf1ce7ab51585a7d8e Mon Sep 17 00:00:00 2001
From: Thomas Sileghem
Date: Thu, 14 Sep 2017 13:25:25 +0100
Subject: [PATCH] feat: deprecate cache in flavour of seed (#84)
BREAKING CHANGE: 'cache' was renamed 'seed'
---
lib/plugin.js | 3 +--
spec/plugin.spec.js | 26 --------------------------
2 files changed, 1 insertion(+), 28 deletions(-)
diff --git a/lib/plugin.js b/lib/plugin.js
index 9f3f7df..cba69f1 100644
--- a/lib/plugin.js
+++ b/lib/plugin.js
@@ -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,
@@ -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) {
diff --git a/spec/plugin.spec.js b/spec/plugin.spec.js
index 1909872..b4323d3 100644
--- a/spec/plugin.spec.js
+++ b/spec/plugin.spec.js
@@ -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,