Skip to content

Commit 6c59e37

Browse files
fix: support webpack@5 (#794)
1 parent 5611f73 commit 6c59e37

25 files changed

+5061
-3267
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ insert_final_newline = true
99
trim_trailing_whitespace = true
1010

1111
[*.md]
12-
insert_final_newline = true
1312
trim_trailing_whitespace = false

.prettierrc

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

.prettierrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
singleQuote: true,
3+
trailingComma: 'es5',
4+
arrowParens: 'always',
5+
};

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -438,22 +438,34 @@ module.exports = {
438438
};
439439
```
440440

441-
> ℹ In some rare cases `node-sass` can output invalid source maps (it is a `node-sass` bug). In order to avoid this, you can try to update `node-sass` to latest version or you can try to set within `sassOptions` the `outputStyle` option to `compressed`.
441+
> ℹ In some rare cases `node-sass` can output invalid source maps (it is a `node-sass` bug).
442+
> In order to avoid this, you can try to update `node-sass` to latest version or you can try to set within `sassOptions` the `outputStyle` option to `compressed`.
442443
443-
```js
444-
{
445-
loader: 'sass-loader',
446-
options: {
447-
sassOptions: {
448-
outputStyle: 'compressed',
449-
},
450-
sourceMap: true,
444+
**webpack.config.js**
445+
446+
```js
447+
module.exports = {
448+
module: {
449+
rules: [
450+
{
451+
test: /\.s[ac]ss$/i,
452+
use: [
453+
'style-loader',
454+
'css-loader',
455+
{
456+
loader: 'sass-loader',
457+
sourceMap: true,
458+
sassOptions: {
459+
outputStyle: 'compressed',
460+
},
461+
},
462+
],
463+
},
464+
],
451465
},
452-
}
466+
};
453467
```
454468

455-
456-
457469
### `webpackImporter`
458470

459471
Type: `Boolean`

azure-pipelines.yml

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ trigger:
22
- master
33
- next
44

5+
variables:
6+
npm_config_cache: $(Pipeline.Workspace)/.npm
7+
58
jobs:
69
- job: Lint
710
pool:
8-
vmImage: ubuntu-16.04
11+
vmImage: ubuntu-latest
912
steps:
1013
- task: NodeTool@0
1114
inputs:
@@ -20,10 +23,12 @@ jobs:
2023
node -v
2124
npm -v
2225
displayName: 'Print versions'
23-
- task: Npm@1
26+
- task: CacheBeta@1
2427
inputs:
25-
command: custom
26-
customCommand: ci
28+
key: npm | $(Agent.OS) | package-lock.json
29+
path: $(npm_config_cache)
30+
displayName: 'Cache npm'
31+
- script: npm ci
2732
displayName: 'Install dependencies'
2833
- script: npm run lint
2934
displayName: 'Run lint'
@@ -34,10 +39,13 @@ jobs:
3439

3540
- job: Linux
3641
pool:
37-
vmImage: ubuntu-16.04
42+
vmImage: ubuntu-latest
3843
strategy:
39-
maxParallel: 4
44+
maxParallel: 5
4045
matrix:
46+
node-13:
47+
node_version: ^13.0.0
48+
webpack_version: latest
4149
node-12:
4250
node_version: ^12.0.0
4351
webpack_version: latest
@@ -47,10 +55,9 @@ jobs:
4755
node-8:
4856
node_version: ^8.9.0
4957
webpack_version: latest
50-
node-8-canary:
51-
node_version: ^8.9.0
58+
node-10-canary:
59+
node_version: ^10.13.0
5260
webpack_version: next
53-
continue_on_error: true
5461
steps:
5562
- task: NodeTool@0
5663
inputs:
@@ -65,10 +72,12 @@ jobs:
6572
node -v
6673
npm -v
6774
displayName: 'Print versions'
68-
- task: Npm@1
75+
- task: CacheBeta@1
6976
inputs:
70-
command: custom
71-
customCommand: ci
77+
key: npm | $(Agent.OS) | package-lock.json
78+
path: $(npm_config_cache)
79+
displayName: 'Cache npm'
80+
- script: npm ci
7281
displayName: 'Install dependencies'
7382
- script: npm i webpack@$(webpack_version)
7483
displayName: 'Install "webpack@$(webpack_version)"'
@@ -86,10 +95,13 @@ jobs:
8695

8796
- job: macOS
8897
pool:
89-
vmImage: macOS-10.14
98+
vmImage: macOS-latest
9099
strategy:
91-
maxParallel: 4
100+
maxParallel: 5
92101
matrix:
102+
node-13:
103+
node_version: ^13.0.0
104+
webpack_version: latest
93105
node-12:
94106
node_version: ^12.0.0
95107
webpack_version: latest
@@ -99,10 +111,9 @@ jobs:
99111
node-8:
100112
node_version: ^8.9.0
101113
webpack_version: latest
102-
node-8-canary:
103-
node_version: ^8.9.0
114+
node-10-canary:
115+
node_version: ^10.13.0
104116
webpack_version: next
105-
continue_on_error: true
106117
steps:
107118
- task: NodeTool@0
108119
inputs:
@@ -117,10 +128,12 @@ jobs:
117128
node -v
118129
npm -v
119130
displayName: 'Print versions'
120-
- task: Npm@1
131+
- task: CacheBeta@1
121132
inputs:
122-
command: custom
123-
customCommand: ci
133+
key: npm | $(Agent.OS) | package-lock.json
134+
path: $(npm_config_cache)
135+
displayName: 'Cache npm'
136+
- script: npm ci
124137
displayName: 'Install dependencies'
125138
- script: npm i webpack@$(webpack_version)
126139
displayName: 'Install "webpack@$(webpack_version)"'
@@ -138,10 +151,13 @@ jobs:
138151

139152
- job: Windows
140153
pool:
141-
vmImage: windows-2019
154+
vmImage: windows-latest
142155
strategy:
143-
maxParallel: 4
156+
maxParallel: 5
144157
matrix:
158+
node-13:
159+
node_version: ^13.0.0
160+
webpack_version: latest
145161
node-12:
146162
node_version: ^12.0.0
147163
webpack_version: latest
@@ -151,10 +167,9 @@ jobs:
151167
node-8:
152168
node_version: ^8.9.0
153169
webpack_version: latest
154-
node-8-canary:
155-
node_version: ^8.9.0
170+
node-10-canary:
171+
node_version: ^10.13.0
156172
webpack_version: next
157-
continue_on_error: true
158173
steps:
159174
- script: 'git config --global core.autocrlf input'
160175
displayName: 'Config git core.autocrlf'
@@ -172,10 +187,12 @@ jobs:
172187
node -v
173188
npm -v
174189
displayName: 'Print versions'
175-
- task: Npm@1
190+
- task: CacheBeta@1
176191
inputs:
177-
command: custom
178-
customCommand: ci
192+
key: npm | $(Agent.OS) | package-lock.json
193+
path: $(npm_config_cache)
194+
displayName: 'Cache npm'
195+
- script: npm ci
179196
displayName: 'Install dependencies'
180197
- script: npm i webpack@$(webpack_version)
181198
displayName: 'Install "webpack@$(webpack_version)"'

lint-staged.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
'*.js': ['prettier --write', 'eslint --fix', 'git add'],
3-
'*.{json,md,yml,css}': ['prettier --write', 'git add'],
3+
'*.{json,md,yml,css,ts}': ['prettier --write', 'git add'],
44
};

0 commit comments

Comments
 (0)