Skip to content

Commit 6657a78

Browse files
committed
using the module directly and removing publicPath option, which is gone
1 parent 9f7a866 commit 6657a78

File tree

6 files changed

+27
-31
lines changed

6 files changed

+27
-31
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/plugins/manifest.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
'use strict';
1111

12-
const ManifestPlugin = require('../webpack/webpack-manifest-plugin');
12+
const ManifestPlugin = require('webpack-manifest-plugin');
1313
const PluginPriorities = require('./plugin-priorities');
1414
const applyOptionsCallback = require('../utils/apply-options-callback');
1515

@@ -28,8 +28,6 @@ module.exports = function(plugins, webpackConfig) {
2828

2929
const manifestPluginOptions = {
3030
basePath: manifestPrefix,
31-
// guarantee the value uses the public path (or CDN public path)
32-
publicPath: webpackConfig.getRealPublicPath(),
3331
// always write a manifest.json file, even with webpack-dev-server
3432
writeToFileEmit: true,
3533
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1+
/*
2+
* This file is part of the Symfony Webpack Encore package.
3+
*
4+
* (c) Fabien Potencier <[email protected]>
5+
*
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
*/
9+
10+
'use strict';
11+
12+
const logger = require('../logger');
13+
logger.deprecation('The lib/webpack/webpack-manifest-plugin.js module is deprecated: require the library directly now: require(\'webpack-manifest-plugin\').');
14+
115
module.exports = require('webpack-manifest-plugin');

test/config-generator.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const WebpackConfig = require('../lib/WebpackConfig');
1414
const RuntimeConfig = require('../lib/config/RuntimeConfig');
1515
const configGenerator = require('../lib/config-generator');
1616
const ExtractTextPlugin = require('extract-text-webpack-plugin');
17-
const ManifestPlugin = require('./../lib/webpack/webpack-manifest-plugin');
17+
const ManifestPlugin = require('webpack-manifest-plugin');
1818
const CleanWebpackPlugin = require('clean-webpack-plugin');
1919
const webpack = require('webpack');
2020

@@ -153,7 +153,6 @@ describe('The config-generator function', () => {
153153

154154
expect(actualConfig.output.publicPath).to.equal('/build/');
155155
const manifestPlugin = findPlugin(ManifestPlugin, actualConfig.plugins);
156-
expect(manifestPlugin.opts.publicPath).to.equal('/build/');
157156
// basePath matches publicPath, *without* the opening slash
158157
// we do that by convention: keys do not start with /
159158
expect(manifestPlugin.opts.basePath).to.equal('build/');
@@ -171,7 +170,6 @@ describe('The config-generator function', () => {
171170

172171
expect(actualConfig.output.publicPath).to.equal('/subdirectory/build/');
173172
const manifestPlugin = findPlugin(ManifestPlugin, actualConfig.plugins);
174-
expect(manifestPlugin.opts.publicPath).to.equal('/subdirectory/build/');
175173
// base path matches manifestKeyPrefix + trailing slash
176174
// the opening slash is kept, since the user is overriding this setting
177175
expect(manifestPlugin.opts.basePath).to.equal('/build/');
@@ -187,7 +185,6 @@ describe('The config-generator function', () => {
187185
const actualConfig = configGenerator(config);
188186

189187
const manifestPlugin = findPlugin(ManifestPlugin, actualConfig.plugins);
190-
expect(manifestPlugin.opts.publicPath).to.equal('/build/');
191188
expect(manifestPlugin.opts.basePath).to.equal('');
192189
});
193190
});

test/plugins/manifest.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'use strict';
1111

1212
const expect = require('chai').expect;
13-
const ManifestPlugin = require('../../lib/webpack/webpack-manifest-plugin');
13+
const ManifestPlugin = require('webpack-manifest-plugin');
1414
const WebpackConfig = require('../../lib/WebpackConfig');
1515
const RuntimeConfig = require('../../lib/config/RuntimeConfig');
1616
const manifestPluginUtil = require('../../lib/plugins/manifest');
@@ -34,7 +34,6 @@ describe('plugins/manifest', () => {
3434
expect(plugins.length).to.equal(1);
3535
expect(plugins[0].plugin).to.be.instanceof(ManifestPlugin);
3636
expect(plugins[0].plugin.opts.fileName).to.equal('manifest.json');
37-
expect(plugins[0].plugin.opts.publicPath).to.equal('/foo/');
3837
});
3938

4039
it('with options callback', () => {
@@ -51,9 +50,6 @@ describe('plugins/manifest', () => {
5150

5251
// Allows to override default options
5352
expect(plugins[0].plugin.opts.fileName).to.equal('bar');
54-
55-
// Doesn't remove default options
56-
expect(plugins[0].plugin.opts.publicPath).to.equal('/foo/');
5753
});
5854

5955
it('with options callback that returns an object', () => {

yarn.lock

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44

55
"@types/node@*":
6-
version "9.6.4"
7-
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.4.tgz#0ef7b4cfc3499881c81e0ea1ce61a23f6f4f5b42"
6+
version "9.6.5"
7+
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.5.tgz#ee700810fdf49ac1c399fc5980b7559b3e5a381d"
88

99
"@types/tapable@^0":
1010
version "0.2.5"
@@ -1229,12 +1229,12 @@ caniuse-api@^1.5.2:
12291229
lodash.uniq "^4.5.0"
12301230

12311231
caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639:
1232-
version "1.0.30000828"
1233-
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000828.tgz#ed6d6f03b5a81fb291c3c0e088828b11a70948bf"
1232+
version "1.0.30000830"
1233+
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000830.tgz#6e45255b345649fd15ff59072da1e12bb3de2f13"
12341234

12351235
caniuse-lite@^1.0.30000792:
1236-
version "1.0.30000828"
1237-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000828.tgz#048f98de213f7a3c047bf78a9523c611855d4fdd"
1236+
version "1.0.30000830"
1237+
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000830.tgz#cb96b8a2dd3cbfe04acea2af3c4e894249095328"
12381238

12391239
caseless@~0.11.0:
12401240
version "0.11.0"
@@ -3772,10 +3772,6 @@ klaw@^1.0.0:
37723772
optionalDependencies:
37733773
graceful-fs "^4.1.9"
37743774

3775-
lazy-cache@^0.2.3:
3776-
version "0.2.7"
3777-
resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-0.2.7.tgz#7feddf2dcb6edb77d11ef1d117ab5ffdf0ab1b65"
3778-
37793775
lazy-cache@^1.0.3:
37803776
version "1.0.4"
37813777
resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"
@@ -4258,6 +4254,10 @@ [email protected]:
42584254
version "0.0.5"
42594255
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0"
42604256

4257+
4258+
version "1.0.1"
4259+
resolved "https://registry.yarnpkg.com/mutexify/-/mutexify-1.0.1.tgz#9880206795d89e75efc1bcb4b4f52ebbd796e5e7"
4260+
42614261
nan@^2.10.0, nan@^2.3.0:
42624262
version "2.10.0"
42634263
resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f"
@@ -4279,14 +4279,6 @@ nanomatch@^1.2.9:
42794279
snapdragon "^0.8.1"
42804280
to-regex "^3.0.1"
42814281

4282-
4283-
version "1.0.1"
4284-
resolved "https://registry.yarnpkg.com/mutexify/-/mutexify-1.0.1.tgz#9880206795d89e75efc1bcb4b4f52ebbd796e5e7"
4285-
4286-
nan@^2.3.0, nan@^2.3.2:
4287-
version "2.6.2"
4288-
resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45"
4289-
42904282
native-promise-only@^0.8.1:
42914283
version "0.8.1"
42924284
resolved "https://registry.yarnpkg.com/native-promise-only/-/native-promise-only-0.8.1.tgz#20a318c30cb45f71fe7adfbf7b21c99c1472ef11"

0 commit comments

Comments
 (0)