Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: minimum require webpack version is 4
BREAKING CHANGE: minimum require `webpack` version is `4`
  • Loading branch information
alexander-akait committed Jul 5, 2018
commit 8db3fb0aa5880250309da5e8432f3de3f66d0fa6
19 changes: 8 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,17 @@ matrix:
fast_finish: true
include:
- os: linux
node_js: "7"
env: WEBPACK_VERSION="2.2.0" JOB_PART=lint
node_js: "10"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we ditch travis and get on circle CI?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shellscape let's do this in other PR

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

env: WEBPACK_VERSION="4.15.0" JOB_PART=lint
- os: linux
node_js: "6"
env: WEBPACK_VERSION="2.2.0" JOB_PART=test
- os: linux
node_js: "4.3"
env: WEBPACK_VERSION="2.2.0" JOB_PART=test
node_js: "10"
env: WEBPACK_VERSION="4.15.0" JOB_PART=test
- os: linux
node_js: "7"
env: WEBPACK_VERSION="2.2.0" JOB_PART=test
node_js: "8"
env: WEBPACK_VERSION="4.15.0" JOB_PART=test
- os: linux
node_js: "4.3"
env: WEBPACK_VERSION="1.14.0" JOB_PART=test
node_js: "6"
env: WEBPACK_VERSION="4.15.0" JOB_PART=test
before_install:
- nvm --version
- node --version
Expand Down
1 change: 0 additions & 1 deletion lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var compileExports = require("./compile-exports");


module.exports = function(content, map) {
if(this.cacheable) this.cacheable();
var callback = this.async();
var query = loaderUtils.getOptions(this) || {};
var moduleMode = query.modules;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because this is a refactor, shouldn't we use const and let instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shellscape also let's do it other PR, when we ship webpack-default in this repo

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Expand Down
1 change: 0 additions & 1 deletion lib/localsLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var compileExports = require("./compile-exports");


module.exports = function(content) {
if(this.cacheable) this.cacheable();
var callback = this.async();
var query = loaderUtils.getOptions(this) || {};
var moduleMode = query.modules;
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"should": "^11.1.2",
"standard-version": "^4.0.0"
},
"peerDependencies": {
"webpack": "^4.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this. The codebase does not require('webpack'). I understand that you added this to avoid runtime errors when webpack's version is not the expected one but I don't think this is the correct solution.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ooflorent we use this for all webpack-contrib repos, better create issue in webpack-default about this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ooflorent Also it is prevent problem with using webpack api between version, if somebody want use css-loader on webpack@3, they can use old version

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it's a standard for webpack-defaults. that peerDep on webpack has been in defaults for a very long time. along with the Requirements section in the defaults README, this serves as a warning to keep people on supported versions of webpack. new major versions of loaders/plugins/utils are webpack@4+ and Node 6+ only.

},
"scripts": {
"lint": "eslint lib test",
"test": "mocha",
Expand Down