Skip to content

Commit f808db6

Browse files
authored
Upgrade dependencies (#324)
* Upgrade @webpack-blocks/assets dependencies * Upgrade @webpack-blocks/dev-server dependencies * Upgrade @webpack-blocks/sass dependencies * Add breaking changes from css-loader * Upgrade minor dependencies * Upgrade @webpack-blocks/babel and @webpack-blocks/eslint * Upgrade travis node versions
1 parent 1741e27 commit f808db6

File tree

21 files changed

+887
-178
lines changed

21 files changed

+887
-178
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ language: node_js
44

55
node_js:
66
- 12
7-
- 8
7+
- 10
88

99
cache:
1010
yarn: true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
"**/**/js-yaml": "^3.13.1",
2626
"**/node-sass/node-gyp/tar": "^2.2.2"
2727
}
28-
}
28+
}

packages/assets/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ module.exports = createConfig([
4040
['*.css', '!*node_modules*'],
4141
[
4242
css.modules({
43-
localIdentName: '[name]--[local]--[hash:base64:5]'
43+
modules: {
44+
localIdentName: '[name]--[local]--[hash:base64:5]'
45+
}
4446
})
4547
]
4648
)
@@ -63,9 +65,9 @@ Will match `*.css` by default if not used with `match()`. You can pass all
6365

6466
The difference to `css()` is that it sets the following `css-loader` options by default:
6567

66-
- `modules: true`
68+
- `modules` option is enabled
6769
- `importLoaders` defaults to `1`
68-
- `localIdentName` defaults to `'[name]--[local]--[hash:base64:5]'` in development and
70+
- `modules.localIdentName` defaults to `'[name]--[local]--[hash:base64:5]'` in development and
6971
`'[hash:base64:10]'` in production
7072

7173
### file(options: ?object)

packages/assets/__tests__/css-modules.test.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ test('css.modules() works', t => {
1616
{
1717
loader: 'css-loader',
1818
options: {
19-
importLoaders: 1,
20-
localIdentName: '[name]--[local]--[hash:base64:5]',
21-
modules: true
19+
modules: {
20+
localIdentName: '[name]--[local]--[hash:base64:5]'
21+
},
22+
importLoaders: 1
2223
}
2324
}
2425
]
@@ -30,7 +31,7 @@ test('css.modules() works with options and match()', t => {
3031
const config = createConfig({}, [
3132
match('*.pcss', { exclude: /node_modules/ }, [
3233
css.modules({
33-
minimize: true
34+
sourceMap: true
3435
})
3536
])
3637
])
@@ -47,10 +48,11 @@ test('css.modules() works with options and match()', t => {
4748
{
4849
loader: 'css-loader',
4950
options: {
51+
modules: {
52+
localIdentName: '[name]--[local]--[hash:base64:5]'
53+
},
5054
importLoaders: 1,
51-
localIdentName: '[name]--[local]--[hash:base64:5]',
52-
modules: true,
53-
minimize: true
55+
sourceMap: true
5456
}
5557
}
5658
]
@@ -62,7 +64,7 @@ test('style-loader can take options', t => {
6264
const config = createConfig({}, [
6365
css.modules({
6466
styleLoader: {
65-
hmr: true
67+
esModule: true
6668
}
6769
})
6870
])
@@ -74,15 +76,16 @@ test('style-loader can take options', t => {
7476
{
7577
loader: 'style-loader',
7678
options: {
77-
hmr: true
79+
esModule: true
7880
}
7981
},
8082
{
8183
loader: 'css-loader',
8284
options: {
83-
importLoaders: 1,
84-
localIdentName: '[name]--[local]--[hash:base64:5]',
85-
modules: true
85+
modules: {
86+
localIdentName: '[name]--[local]--[hash:base64:5]'
87+
},
88+
importLoaders: 1
8689
}
8790
}
8891
]
@@ -104,9 +107,10 @@ test('style-loader can be disabled', t => {
104107
{
105108
loader: 'css-loader',
106109
options: {
107-
importLoaders: 1,
108-
localIdentName: '[name]--[local]--[hash:base64:5]',
109-
modules: true
110+
modules: {
111+
localIdentName: '[name]--[local]--[hash:base64:5]'
112+
},
113+
importLoaders: 1
110114
}
111115
}
112116
]

packages/assets/__tests__/css.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ test('css() works with options and match()', t => {
2626
const config = createConfig({}, [
2727
match('*.pcss', { exclude: /node_modules/ }, [
2828
css({
29-
minimize: true
29+
sourceMaps: true
3030
})
3131
])
3232
])
@@ -43,7 +43,7 @@ test('css() works with options and match()', t => {
4343
{
4444
loader: 'css-loader',
4545
options: {
46-
minimize: true
46+
sourceMaps: true
4747
}
4848
}
4949
]
@@ -55,7 +55,7 @@ test('style-loader can take options', t => {
5555
const config = createConfig({}, [
5656
css({
5757
styleLoader: {
58-
hmr: true
58+
esModule: true
5959
}
6060
})
6161
])
@@ -67,7 +67,7 @@ test('style-loader can take options', t => {
6767
{
6868
loader: 'style-loader',
6969
options: {
70-
hmr: true
70+
esModule: true
7171
}
7272
},
7373
{

packages/assets/lib/css.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,22 @@ function css(options = {}) {
3232
/**
3333
* @param {object} [options] You can pass all css-loader options.
3434
* @param {number} [options.importLoaders] Defaults to 1.
35-
* @param {string} [options.localIdentName] Defaults to '[hash:base64:10]' in production, '[name]--[local]--[hash:base64:5]' in development.
35+
* @param {string} [options.modules.localIdentName] Defaults to '[hash:base64:10]' in production, '[name]--[local]--[hash:base64:5]' in development.
3636
* @param {object} [options.styleLoader] style-loader options. If set to 'false' the 'style-loader' won't be added.
3737
* @return {Function}
3838
* @see https://github.com/webpack-contrib/css-loader
3939
*/
4040
function cssModules(options = {}) {
4141
const defaultCssOptions = {
42-
modules: true,
43-
importLoaders: 1,
44-
localIdentName:
45-
String(process.env.NODE_ENV) === 'production'
46-
? '[hash:base64:10]'
47-
: '[name]--[local]--[hash:base64:5]'
42+
modules: {
43+
localIdentName:
44+
String(process.env.NODE_ENV) === 'production'
45+
? '[hash:base64:10]'
46+
: '[name]--[local]--[hash:base64:5]'
47+
},
48+
importLoaders: 1
4849
}
49-
const cssOptions = Object.assign(
50+
const cssOptions = _.merge(
5051
defaultCssOptions,
5152
_.omit(options, ['exclude', 'include', 'styleLoader'])
5253
)

packages/assets/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"author": "Andy Wermke <andy@dev.next-step-software.com>",
88
"engines": {
9-
"node": ">= 6.0"
9+
"node": ">= 10.13.0"
1010
},
1111
"keywords": [
1212
"webpack",
@@ -15,11 +15,11 @@
1515
"repository": "andywer/webpack-blocks",
1616
"bugs": "https://github.com/andywer/webpack-blocks/issues",
1717
"dependencies": {
18-
"css-loader": "^1.0.0",
19-
"file-loader": "^2.0.0",
20-
"lodash": "^4.17.11",
21-
"style-loader": "^0.23.1",
22-
"url-loader": "^1.1.2"
18+
"css-loader": "^3.5.2",
19+
"file-loader": "^6.0.0",
20+
"lodash": "^4.17.15",
21+
"style-loader": "^1.1.4",
22+
"url-loader": "^4.1.0"
2323
},
2424
"devDependencies": {
2525
"@webpack-blocks/core": "^2.0.0",

packages/babel/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
"repository": "andywer/webpack-blocks",
1616
"bugs": "https://github.com/andywer/webpack-blocks/issues",
1717
"dependencies": {
18-
"babel-loader": "^8.0.4"
18+
"babel-loader": "^8.1.0"
1919
},
2020
"devDependencies": {
2121
"@babel/core": "^7.2.2",
2222
"@webpack-blocks/core": "^2.0.0",
2323
"webpack": "^4.20.2"
2424
},
2525
"peerDependencies": {
26-
"@webpack-blocks/core": "^2.0.0",
27-
"@babel/core": "^7.0.0"
26+
"@babel/core": "^7.0.0",
27+
"@webpack-blocks/core": "^2.0.0"
2828
}
2929
}

packages/core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"repository": "andywer/webpack-blocks",
1919
"bugs": "https://github.com/andywer/webpack-blocks/issues",
2020
"dependencies": {
21-
"glob-to-regexp": "^0.4.0",
22-
"lodash": "^4.17.11",
23-
"webpack-merge": "^4.1.4"
21+
"glob-to-regexp": "^0.4.1",
22+
"lodash": "^4.17.15",
23+
"webpack-merge": "^4.2.2"
2424
},
2525
"devDependencies": {
2626
"sinon": "^6.3.5",

packages/dev-server/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"author": "Andy Wermke <andy@dev.next-step-software.com>",
88
"engines": {
9-
"node": ">= 6.0"
9+
"node": ">= 6.11.5"
1010
},
1111
"keywords": [
1212
"webpack",
@@ -15,10 +15,10 @@
1515
"repository": "andywer/webpack-blocks",
1616
"bugs": "https://github.com/andywer/webpack-blocks/issues",
1717
"dependencies": {
18-
"webpack": "^4.20.2",
19-
"webpack-dev-server": "^3.7.1"
18+
"webpack": "^4.42.1",
19+
"webpack-dev-server": "^3.10.3"
2020
},
2121
"peerDependencies": {
2222
"@webpack-blocks/core": "^2.0.0"
2323
}
24-
}
24+
}

packages/eslint/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"author": "Dmytro Meleshko <dmytro.meleshko@gmail.com>",
88
"engines": {
9-
"node": ">= 6.0"
9+
"node": ">= 10.13.0"
1010
},
1111
"keywords": [
1212
"webpack",
@@ -15,7 +15,7 @@
1515
"repository": "andywer/webpack-blocks",
1616
"bugs": "https://github.com/andywer/webpack-blocks/issues",
1717
"dependencies": {
18-
"eslint-loader": "^2.1.1"
18+
"eslint-loader": "^4.0.0"
1919
},
2020
"devDependencies": {
2121
"@webpack-blocks/core": "^2.0.0",

packages/postcss/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"repository": "andywer/webpack-blocks",
1616
"bugs": "https://github.com/andywer/webpack-blocks/issues",
1717
"dependencies": {
18-
"lodash": "^4.17.11",
18+
"lodash": "^4.17.15",
1919
"postcss-loader": "^3.0.0"
2020
},
2121
"devDependencies": {

packages/sample-app/__tests__/__snapshots__/webpack-config.test.js.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ Generated by [AVA](https://ava.li).
5353
loader: 'css-loader',
5454
options: {
5555
importLoaders: 1,
56-
localIdentName: '[name]--[local]--[hash:base64:5]',
57-
modules: true,
56+
modules: {
57+
localIdentName: '[name]--[local]--[hash:base64:5]',
58+
},
5859
},
5960
},
6061
],
@@ -153,8 +154,9 @@ Generated by [AVA](https://ava.li).
153154
loader: 'css-loader',
154155
options: {
155156
importLoaders: 1,
156-
localIdentName: '[hash:base64:10]',
157-
modules: true,
157+
modules: {
158+
localIdentName: '[hash:base64:10]',
159+
},
158160
},
159161
},
160162
{
Binary file not shown.

packages/sass/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const sass = require('@webpack-blocks/sass')
1616
module.exports = createConfig([
1717
match(['*.scss', '!*node_modules*'], [
1818
css(),
19-
sass(/* node-sass options */)
19+
sass({ sassOptions: {/* node-sass options */} })
2020
])
2121
])
2222
```
@@ -26,8 +26,9 @@ module.exports = createConfig([
2626

2727
## Options
2828

29-
You can pass any [sass-loader / node-sass options](https://github.com/sass/node-sass#options) as an
30-
object to the `sass` block.
29+
You can pass any [sass-loader](https://github.com/webpack-contrib/sass-loader) as an object to the
30+
`sass` block. For example you can pass
31+
[node-sass options](https://github.com/sass/node-sass#options) in the `sassOptions` property.
3132

3233
## Examples
3334

packages/sass/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ module.exports = sass
88

99
/**
1010
* @param {object} [options] See https://github.com/sass/node-sass#options
11-
* @param {string[]} [options.includePaths]
12-
* @param {bool} [options.indentedSyntax]
13-
* @param {string} [options.outputStyle]
11+
* @param {string[]} [options.sassOptions.includePaths]
12+
* @param {bool} [options.sassOptions.indentedSyntax]
13+
* @param {string} [options.sassOptions.outputStyle]
1414
* @param {bool} [options.sourceMap]
1515
* @return {Function}
1616
*/

packages/sass/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"author": "Andy Wermke <andy@dev.next-step-software.com>",
88
"engines": {
9-
"node": ">= 6.0"
9+
"node": ">= 8.9.0"
1010
},
1111
"keywords": [
1212
"webpack",
@@ -15,11 +15,11 @@
1515
"repository": "andywer/webpack-blocks",
1616
"bugs": "https://github.com/andywer/webpack-blocks/issues",
1717
"dependencies": {
18-
"css-loader": "^1.0.0",
19-
"lodash": "^4.17.11",
20-
"node-sass": "^4.12.0",
21-
"sass-loader": "^7.1.0",
22-
"style-loader": "^0.23.1"
18+
"css-loader": "^3.5.2",
19+
"lodash": "^4.17.15",
20+
"node-sass": "^4.13.1",
21+
"sass-loader": "^8.0.2",
22+
"style-loader": "^1.1.4"
2323
},
2424
"devDependencies": {
2525
"@webpack-blocks/assets": "^2.0.1",

packages/uglify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"bugs": "https://github.com/andywer/webpack-blocks/issues",
1919
"dependencies": {
2020
"uglifyjs-webpack-plugin": "^1.3.0",
21-
"webpack-merge": "^4.1.4"
21+
"webpack-merge": "^4.2.2"
2222
},
2323
"devDependencies": {
2424
"@webpack-blocks/core": "^2.0.0",

0 commit comments

Comments
 (0)