Skip to content

Commit c697eda

Browse files
author
Matt Lewis
committed
feat: allow webpack3 peer dependency
1 parent 83837f7 commit c697eda

File tree

6 files changed

+114
-81
lines changed

6 files changed

+114
-81
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
yarn.lock -diff
22

33
* text=auto
4-
bin/* eol=lf
4+
bin/* eol=lf
5+
package-lock.json -diff

.travis.yml

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,48 @@
11
sudo: false
2+
dist: trusty
23
language: node_js
34
branches:
45
only:
56
- master
6-
matrix:
7+
jobs:
78
fast_finish: true
9+
allow_failures:
10+
- env: WEBPACK_VERSION=canary
811
include:
9-
- os: linux
10-
node_js: '7'
11-
env: WEBPACK_VERSION="2.2.0" JOB_PART=lint
12-
- os: linux
13-
node_js: '4.3'
14-
env: WEBPACK_VERSION="2.2.0" JOB_PART=test
15-
- os: linux
16-
node_js: '6'
17-
env: WEBPACK_VERSION="2.2.0" JOB_PART=test
18-
- os: linux
19-
node_js: '7'
20-
env: WEBPACK_VERSION="2.2.0" JOB_PART=coverage
12+
- &test-latest
13+
stage: Webpack latest
14+
nodejs: 6
15+
env: WEBPACK_VERSION=latest JOB_PART=test
16+
script: npm run travis:$JOB_PART
17+
- <<: *test-latest
18+
nodejs: 4.3
19+
env: WEBPACK_VERSION=latest JOB_PART=test
20+
script: npm run travis:$JOB_PART
21+
- <<: *test-latest
22+
node_js: 8
23+
env: WEBPACK_VERSION=latest JOB_PART=lint
24+
script: npm run travis:$JOB_PART
25+
- <<: *test-latest
26+
node_js: 8
27+
env: WEBPACK_VERSION=latest JOB_PART=coverage
28+
script: npm run travis:$JOB_PART
29+
after_success: 'bash <(curl -s https://codecov.io/bash)'
30+
- stage: Webpack canary
31+
before_script: npm i --no-save git://github.com/webpack/webpack.git#master
32+
script: npm run travis:$JOB_PART
33+
node_js: 8
34+
env: WEBPACK_VERSION=canary JOB_PART=test
2135
before_install:
36+
- 'if [[ `npm -v` != 5* ]]; then npm i -g npm@^5.0.0; fi'
2237
- nvm --version
2338
- node --version
39+
- npm --version
2440
before_script:
2541
- |-
2642
if [ "$WEBPACK_VERSION" ]; then
27-
yarn add webpack@^$WEBPACK_VERSION
43+
npm i --no-save webpack@$WEBPACK_VERSION
2844
fi
2945
script:
30-
- 'yarn run pretest'
31-
- 'yarn run travis:$JOB_PART'
46+
- 'npm run travis:$JOB_PART'
3247
after_success:
3348
- 'bash <(curl -s https://codecov.io/bash)'

appveyor.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
1-
# appveyor file
2-
# http://www.appveyor.com/docs/appveyor-yml
3-
4-
init:
5-
- git config --global core.autocrlf input
6-
71
branches:
82
only:
93
- master
10-
11-
# what combinations to test
4+
init:
5+
- git config --global core.autocrlf input
126
environment:
137
matrix:
14-
- nodejs_version: 7
8+
- nodejs_version: '8'
9+
webpack_version: 2.6.0
1510
job_part: test
16-
- nodejs_version: 6
11+
- nodejs_version: '6'
12+
webpack_version: 2.6.0
1713
job_part: test
18-
- nodejs_version: 4
14+
- nodejs_version: '4.3'
15+
webpack_version: 2.6.0
1916
job_part: test
20-
21-
install:
22-
- ps: Install-Product node $env:nodejs_version x64
23-
- yarn install
24-
25-
build: off
26-
17+
build: 'off'
2718
matrix:
2819
fast_finish: true
29-
20+
install:
21+
- 'ps: Install-Product node $env:nodejs_version x64'
22+
- npm install
23+
before_test:
24+
- 'cmd: npm install webpack@^%webpack_version%'
3025
test_script:
3126
- node --version
3227
- npm --version
33-
- cmd: yarn run appveyor:%job_part%
28+
- 'cmd: npm run appveyor:%job_part%'

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@
33
"version": "4.0.4",
44
"author": "Johannes Ewald @jhnns",
55
"description": "Less loader for webpack. Compiles Less to CSS.",
6-
"main": "dist/index.js",
6+
"main": "dist/cjs.js",
77
"scripts": {
88
"create-spec": "babel-node test/helpers/createSpec.js",
99
"pretest": "npm run create-spec",
1010
"test": "jest",
1111
"posttest": "npm run lint",
12-
"travis:test": "yarn run test",
13-
"appveyor:test": "npm test",
12+
"travis:test": "npm run test -- --runInBand",
13+
"appveyor:test": "npm run test",
1414
"lint": "eslint --cache src test",
1515
"webpack-defaults": "webpack-defaults",
16-
"start": "yarn run build -- -w",
16+
"start": "npm run build -- -w",
1717
"build": "cross-env NODE_ENV=production babel src -d dist --ignore 'src/**/*.test.js'",
1818
"clean:dist": "del-cli dist",
1919
"lint-staged": "lint-staged",
20-
"prebuild": "yarn run clean",
21-
"prepublish": "yarn run build",
22-
"release": "yarn run standard-version",
20+
"prebuild": "npm run clean",
21+
"prepublish": "npm run build",
22+
"release": "standard-version",
2323
"security": "nsp check",
2424
"serve:dev": "nodemon $2 --exec babel-node",
2525
"test:watch": "jest --watch",
2626
"test:coverage": "jest --collectCoverageFrom='src/**/*.js' --coverage",
27-
"travis:coverage": "yarn run test:coverage",
28-
"travis:lint": "yarn run lint && yarn run security",
27+
"travis:coverage": "npm run test:coverage -- --runInBand",
28+
"travis:lint": "npm run lint && npm run security",
2929
"clean": "del-cli dist"
3030
},
3131
"engines": {
@@ -38,7 +38,7 @@
3838
},
3939
"peerDependencies": {
4040
"less": "^2.3.1",
41-
"webpack": "^2.2.0"
41+
"webpack": "^2.0.0 || >= 3.0.0-rc.0 || ^3.0.0"
4242
},
4343
"devDependencies": {
4444
"babel-cli": "^6.24.0",
@@ -59,8 +59,8 @@
5959
"nsp": "^2.6.3",
6060
"pre-commit": "^1.2.2",
6161
"standard-version": "^4.0.0",
62-
"webpack": "^2.3.2",
63-
"webpack-defaults": "^1.0.1"
62+
"webpack": "^3.0.0",
63+
"webpack-defaults": "^1.4.0"
6464
},
6565
"repository": {
6666
"type": "git",
@@ -79,4 +79,4 @@
7979
"git add"
8080
]
8181
}
82-
}
82+
}

src/cjs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./index').default;

yarn.lock

Lines changed: 52 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,30 @@ agent-base@2:
5454
extend "~3.0.0"
5555
semver "~5.0.1"
5656

57-
ajv-keywords@^1.0.0, ajv-keywords@^1.1.1:
57+
ajv-keywords@^1.0.0:
5858
version "1.5.1"
5959
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c"
6060

61+
ajv-keywords@^2.0.0:
62+
version "2.1.0"
63+
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.0.tgz#a296e17f7bfae7c1ce4f7e0de53d29cb32162df0"
64+
6165
ajv@^4.7.0, ajv@^4.9.1:
6266
version "4.11.8"
6367
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536"
6468
dependencies:
6569
co "^4.6.0"
6670
json-stable-stringify "^1.0.1"
6771

72+
ajv@^5.1.5:
73+
version "5.2.0"
74+
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.2.0.tgz#c1735024c5da2ef75cc190713073d44f098bf486"
75+
dependencies:
76+
co "^4.6.0"
77+
fast-deep-equal "^0.1.0"
78+
json-schema-traverse "^0.3.0"
79+
json-stable-stringify "^1.0.1"
80+
6881
align-text@^0.1.1, align-text@^0.1.3:
6982
version "0.1.4"
7083
resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
@@ -1951,6 +1964,10 @@ extsprintf@1.0.2:
19511964
version "1.0.2"
19521965
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"
19531966

1967+
fast-deep-equal@^0.1.0:
1968+
version "0.1.0"
1969+
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-0.1.0.tgz#5c6f4599aba6b333ee3342e2ed978672f1001f8d"
1970+
19541971
fast-levenshtein@~2.0.4:
19551972
version "2.0.6"
19561973
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
@@ -3007,6 +3024,10 @@ json-loader@^0.5.4:
30073024
version "0.5.4"
30083025
resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.4.tgz#8baa1365a632f58a3c46d20175fc6002c96e37de"
30093026

3027+
json-schema-traverse@^0.3.0:
3028+
version "0.3.0"
3029+
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.0.tgz#0016c0b1ca1efe46d44d37541bcdfc19dcfae0db"
3030+
30103031
json-schema@0.2.3:
30113032
version "0.2.3"
30123033
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
@@ -3186,15 +3207,6 @@ loader-runner@^2.3.0:
31863207
version "2.3.0"
31873208
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"
31883209

3189-
loader-utils@^0.2.16:
3190-
version "0.2.17"
3191-
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348"
3192-
dependencies:
3193-
big.js "^3.1.3"
3194-
emojis-list "^2.0.0"
3195-
json5 "^0.5.0"
3196-
object-assign "^4.0.1"
3197-
31983210
loader-utils@^1.0.3, loader-utils@^1.1.0:
31993211
version "1.1.0"
32003212
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd"
@@ -4420,9 +4432,9 @@ sntp@1.x.x:
44204432
dependencies:
44214433
hoek "2.x.x"
44224434

4423-
source-list-map@^1.1.1:
4424-
version "1.1.2"
4425-
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-1.1.2.tgz#9889019d1024cce55cdc069498337ef6186a11a1"
4435+
source-list-map@^2.0.0:
4436+
version "2.0.0"
4437+
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085"
44264438

44274439
source-map-support@^0.4.2:
44284440
version "0.4.15"
@@ -4809,9 +4821,9 @@ typedarray@^0.0.6:
48094821
version "0.0.6"
48104822
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
48114823

4812-
uglify-js@^2.6, uglify-js@^2.8.27:
4813-
version "2.8.27"
4814-
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.27.tgz#47787f912b0f242e5b984343be8e35e95f694c9c"
4824+
uglify-js@^2.6, uglify-js@^2.8.29:
4825+
version "2.8.29"
4826+
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd"
48154827
dependencies:
48164828
source-map "~0.5.1"
48174829
yargs "~3.10.0"
@@ -4822,6 +4834,14 @@ uglify-to-browserify@~1.0.0:
48224834
version "1.0.2"
48234835
resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"
48244836

4837+
uglifyjs-webpack-plugin@^0.4.4:
4838+
version "0.4.6"
4839+
resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309"
4840+
dependencies:
4841+
source-map "^0.5.6"
4842+
uglify-js "^2.8.29"
4843+
webpack-sources "^1.0.1"
4844+
48254845
uid-number@^0.0.6:
48264846
version "0.0.6"
48274847
resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81"
@@ -4951,9 +4971,9 @@ webidl-conversions@^4.0.0:
49514971
version "4.0.1"
49524972
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.1.tgz#8015a17ab83e7e1b311638486ace81da6ce206a0"
49534973

4954-
webpack-defaults@^1.0.1:
4955-
version "1.0.1"
4956-
resolved "https://registry.yarnpkg.com/webpack-defaults/-/webpack-defaults-1.0.1.tgz#73c40b85c02b4e6408576fd03a59325c0215a978"
4974+
webpack-defaults@^1.4.0:
4975+
version "1.4.0"
4976+
resolved "https://registry.yarnpkg.com/webpack-defaults/-/webpack-defaults-1.4.0.tgz#2aa873a32ebe9bd0aff9d15c22c40c778683df46"
49574977
dependencies:
49584978
chalk "^1.1.3"
49594979
mrm-core "^1.1.0"
@@ -4964,37 +4984,38 @@ webpack-merge@^4.0.0:
49644984
dependencies:
49654985
lodash "^4.17.4"
49664986

4967-
webpack-sources@^0.2.3:
4968-
version "0.2.3"
4969-
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.2.3.tgz#17c62bfaf13c707f9d02c479e0dcdde8380697fb"
4987+
webpack-sources@^1.0.1:
4988+
version "1.0.1"
4989+
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.0.1.tgz#c7356436a4d13123be2e2426a05d1dad9cbe65cf"
49704990
dependencies:
4971-
source-list-map "^1.1.1"
4991+
source-list-map "^2.0.0"
49724992
source-map "~0.5.3"
49734993

4974-
webpack@^2.3.2:
4975-
version "2.6.1"
4976-
resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.6.1.tgz#2e0457f0abb1ac5df3ab106c69c672f236785f07"
4994+
webpack@^3.0.0:
4995+
version "3.0.0"
4996+
resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.0.0.tgz#ee9bcebf21247f7153cb410168cab45e3a59d4d7"
49774997
dependencies:
49784998
acorn "^5.0.0"
49794999
acorn-dynamic-import "^2.0.0"
4980-
ajv "^4.7.0"
4981-
ajv-keywords "^1.1.1"
5000+
ajv "^5.1.5"
5001+
ajv-keywords "^2.0.0"
49825002
async "^2.1.2"
49835003
enhanced-resolve "^3.0.0"
5004+
escope "^3.6.0"
49845005
interpret "^1.0.0"
49855006
json-loader "^0.5.4"
49865007
json5 "^0.5.1"
49875008
loader-runner "^2.3.0"
4988-
loader-utils "^0.2.16"
5009+
loader-utils "^1.1.0"
49895010
memory-fs "~0.4.1"
49905011
mkdirp "~0.5.0"
49915012
node-libs-browser "^2.0.0"
49925013
source-map "^0.5.3"
49935014
supports-color "^3.1.0"
49945015
tapable "~0.2.5"
4995-
uglify-js "^2.8.27"
5016+
uglifyjs-webpack-plugin "^0.4.4"
49965017
watchpack "^1.3.1"
4997-
webpack-sources "^0.2.3"
5018+
webpack-sources "^1.0.1"
49985019
yargs "^6.0.0"
49995020

50005021
whatwg-encoding@^1.0.1:

0 commit comments

Comments
 (0)