Skip to content

Commit aeea89b

Browse files
committed
Update various dependencies and remove the LoaderOptionsPlugin
1 parent 0facc4d commit aeea89b

File tree

14 files changed

+1306
-1921
lines changed

14 files changed

+1306
-1921
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cache:
33
- "%LOCALAPPDATA%\\Yarn"
44

55
environment:
6-
nodejs_version: "6"
6+
nodejs_version: "8"
77

88
platform:
99
- x86

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ matrix:
3030
- os: linux
3131
node_js: "10"
3232
env: JOB_PART=travis:lint
33+
- os: linux
34+
node_js: "11"
35+
env: JOB_PART=test
3336
- os: linux
3437
node_js: "10"
3538
env: JOB_PART=test
@@ -39,8 +42,5 @@ matrix:
3942
- os: linux
4043
node_js: "8"
4144
env: JOB_PART=test
42-
- os: linux
43-
node_js: "6"
44-
env: JOB_PART=test
4545

4646
script: npm run $JOB_PART

index.js

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -164,25 +164,6 @@ class Encore {
164164
return this;
165165
}
166166

167-
/**
168-
* Allows you to configure the options passed to the LoaderOptionsPlugins.
169-
* A list of available options can be found at https://webpack.js.org/plugins/loader-options-plugin/
170-
*
171-
* For example:
172-
*
173-
* Encore.configureLoaderOptionsPlugin((options) => {
174-
* options.minimize = true;
175-
* })
176-
*
177-
* @param {function} loaderOptionsPluginOptionsCallback
178-
* @returns {Encore}
179-
*/
180-
configureLoaderOptionsPlugin(loaderOptionsPluginOptionsCallback = () => {}) {
181-
webpackConfig.configureLoaderOptionsPlugin(loaderOptionsPluginOptionsCallback);
182-
183-
return this;
184-
}
185-
186167
/**
187168
* Allows you to configure the options passed to webpack-manifest-plugin.
188169
* A list of available options can be found at https://github.com/danethurber/webpack-manifest-plugin
@@ -1255,6 +1236,14 @@ class Encore {
12551236
configureUglifyJsPlugin() {
12561237
throw new Error('The configureUglifyJsPlugin() method was removed from Encore due to uglify-js dropping ES6+ support in its latest version. Please use configureTerserPlugin() instead.');
12571238
}
1239+
1240+
/**
1241+
* @deprecated
1242+
* @return {void}
1243+
*/
1244+
configureLoaderOptionsPlugin() {
1245+
throw new Error('The configureLoaderOptionsPlugin() method was removed from Encore. The underlying plugin should not be needed anymore unless you are using outdated loaders. If that\'s the case you can still add it using addPlugin().');
1246+
}
12581247
}
12591248

12601249
// Proxy the API in order to prevent calls to most of its methods

lib/WebpackConfig.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ class WebpackConfig {
109109
this.definePluginOptionsCallback = () => {};
110110
this.forkedTypeScriptTypesCheckOptionsCallback = () => {};
111111
this.friendlyErrorsPluginOptionsCallback = () => {};
112-
this.loaderOptionsPluginOptionsCallback = () => {};
113112
this.manifestPluginOptionsCallback = () => {};
114113
this.terserPluginOptionsCallback = () => {};
115114
this.optimizeCssPluginOptionsCallback = () => {};
@@ -208,14 +207,6 @@ class WebpackConfig {
208207
this.friendlyErrorsPluginOptionsCallback = friendlyErrorsPluginOptionsCallback;
209208
}
210209

211-
configureLoaderOptionsPlugin(loaderOptionsPluginOptionsCallback = () => {}) {
212-
if (typeof loaderOptionsPluginOptionsCallback !== 'function') {
213-
throw new Error('Argument 1 to configureLoaderOptionsPlugin() must be a callback function');
214-
}
215-
216-
this.loaderOptionsPluginOptionsCallback = loaderOptionsPluginOptionsCallback;
217-
}
218-
219210
configureManifestPlugin(manifestPluginOptionsCallback = () => {}) {
220211
if (typeof manifestPluginOptionsCallback !== 'function') {
221212
throw new Error('Argument 1 to configureManifestPlugin() must be a callback function');

lib/config-generator.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const miniCssExtractPluginUtil = require('./plugins/mini-css-extract');
2727
const deleteUnusedEntriesPluginUtil = require('./plugins/delete-unused-entries');
2828
const entryFilesManifestPlugin = require('./plugins/entry-files-manifest');
2929
const manifestPluginUtil = require('./plugins/manifest');
30-
const loaderOptionsPluginUtil = require('./plugins/loader-options');
3130
const versioningPluginUtil = require('./plugins/versioning');
3231
const variableProviderPluginUtil = require('./plugins/variable-provider');
3332
const cleanPluginUtil = require('./plugins/clean');
@@ -401,8 +400,6 @@ class ConfigGenerator {
401400
// Dump the manifest.json file
402401
manifestPluginUtil(plugins, this.webpackConfig);
403402

404-
loaderOptionsPluginUtil(plugins, this.webpackConfig);
405-
406403
versioningPluginUtil(plugins, this.webpackConfig);
407404

408405
variableProviderPluginUtil(plugins, this.webpackConfig);

lib/loaders/css.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ module.exports = {
2222
const usePostCssLoader = webpackConfig.usePostCssLoader;
2323

2424
const options = {
25-
minimize: webpackConfig.isProduction(),
2625
sourceMap: webpackConfig.useSourceMaps,
2726
// when using @import, how many loaders *before* css-loader should
2827
// be applied to those imports? This defaults to 0. When postcss-loader

lib/plugins/loader-options.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"url": "https://github.com/symfony/webpack-encore/issues"
2222
},
2323
"engines": {
24-
"node": ">=6.0.0"
24+
"node": ">=8.0.0"
2525
},
2626
"homepage": "https://github.com/symfony/webpack-encore",
2727
"dependencies": {
@@ -32,7 +32,7 @@
3232
"babel-loader": "^8.0.0",
3333
"chalk": "^2.4.1",
3434
"clean-webpack-plugin": "^0.1.19",
35-
"css-loader": "^1.0.0",
35+
"css-loader": "^2.1.1",
3636
"fast-levenshtein": "^2.0.6",
3737
"file-loader": "^1.1.10",
3838
"friendly-errors-webpack-plugin": "^1.7.0",
@@ -43,7 +43,7 @@
4343
"optimize-css-assets-webpack-plugin": "^5.0.1",
4444
"pkg-up": "^1.0.0",
4545
"pretty-error": "^2.1.1",
46-
"resolve-url-loader": "^2.3.0",
46+
"resolve-url-loader": "^3.0.1",
4747
"semver": "^5.5.0",
4848
"style-loader": "^0.21.0",
4949
"terser-webpack-plugin": "^1.1.0",
@@ -61,21 +61,21 @@
6161
"@babel/plugin-transform-react-jsx": "^7.0.0",
6262
"@babel/preset-react": "^7.0.0",
6363
"autoprefixer": "^8.5.0",
64-
"babel-eslint": "^8.2.1",
64+
"babel-eslint": "^10.0.1",
6565
"chai": "^3.5.0",
6666
"chai-fs": "^1.0.0",
67-
"eslint": "^4.15.0",
68-
"eslint-loader": "^1.9.0",
67+
"eslint": "^5.15.2",
68+
"eslint-loader": "^2.1.2",
6969
"eslint-plugin-header": "^1.0.0",
7070
"eslint-plugin-import": "^2.8.0",
7171
"eslint-plugin-node": "^4.2.2",
7272
"fork-ts-checker-webpack-plugin": "^0.4.1",
7373
"handlebars": "^4.0.11",
7474
"handlebars-loader": "^1.7.0",
75-
"http-server": "^0.9.0",
76-
"less": "^2.7.2",
75+
"http-server": "^0.11.1",
76+
"less": "^3.9.0",
7777
"less-loader": "^4.1.0",
78-
"mocha": "^3.2.0",
78+
"mocha": "^6.0.2",
7979
"node-sass": "^4.5.3",
8080
"postcss-loader": "^3.0.0",
8181
"preact": "^8.2.1",
@@ -93,7 +93,7 @@
9393
"vue-loader": "^15.0.11",
9494
"vue-template-compiler": "^2.3.4",
9595
"webpack-notifier": "^1.6.0",
96-
"zombie": "^5.0.5"
96+
"zombie": "^6.1.4"
9797
},
9898
"files": [
9999
"lib/",

test/WebpackConfig.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -283,24 +283,6 @@ describe('WebpackConfig object', () => {
283283
});
284284
});
285285

286-
describe('configureLoaderOptionsPlugin', () => {
287-
it('Setting callback', () => {
288-
const config = createConfig();
289-
const callback = () => {};
290-
config.configureLoaderOptionsPlugin(callback);
291-
292-
expect(config.loaderOptionsPluginOptionsCallback).to.equal(callback);
293-
});
294-
295-
it('Setting invalid callback argument', () => {
296-
const config = createConfig();
297-
298-
expect(() => {
299-
config.configureLoaderOptionsPlugin('foo');
300-
}).to.throw('Argument 1 to configureLoaderOptionsPlugin() must be a callback function');
301-
});
302-
});
303-
304286
describe('configureManifestPlugin', () => {
305287
it('Setting callback', () => {
306288
const config = createConfig();

test/config-generator.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,6 @@ describe('The config-generator function', () => {
220220
config.enableVersioning(true);
221221

222222
const actualConfig = configGenerator(config);
223-
224-
const loaderOptionsPlugin = findPlugin(webpack.LoaderOptionsPlugin, actualConfig.plugins);
225-
expect(loaderOptionsPlugin.options.debug).to.equal(true);
226-
expect(loaderOptionsPlugin.options.options.context).to.equal('/tmp/context');
227-
expect(loaderOptionsPlugin.options.options.output.path).to.equal('/tmp/output/public-path');
228-
229223
expect(actualConfig.optimization.namedModules).to.be.true;
230224
});
231225

@@ -239,9 +233,6 @@ describe('The config-generator function', () => {
239233

240234
const actualConfig = configGenerator(config);
241235

242-
const loaderOptionsPlugin = findPlugin(webpack.LoaderOptionsPlugin, actualConfig.plugins);
243-
expect(loaderOptionsPlugin.options.debug).to.equal(false);
244-
245236
const moduleHashedIdsPlugin = findPlugin(webpack.HashedModuleIdsPlugin, actualConfig.plugins);
246237
expect(moduleHashedIdsPlugin).to.not.be.undefined;
247238
expect(actualConfig.optimization.namedModules).to.be.undefined;

0 commit comments

Comments
 (0)