Skip to content

Commit 087af7c

Browse files
committed
Merge branch 'webpack-4' into patch-2
2 parents f170b98 + d4603c6 commit 087af7c

6 files changed

Lines changed: 143 additions & 34 deletions

File tree

declarations/WebpackOptions.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,10 @@ export interface ResolveOptions {
709709
resolver?: {
710710
[k: string]: any;
711711
};
712+
/**
713+
* A list of directories in which requests that are server-relative URLs (starting with '/') are resolved. On non-windows system these requests are tried to resolve as absolute path first.
714+
*/
715+
roots?: string[];
712716
/**
713717
* Enable resolving symlinks to the original location
714718
*/

lib/WebpackOptionsDefaulter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
362362
this.set("resolveLoader.mainFields", ["loader", "main"]);
363363
this.set("resolveLoader.extensions", [".js", ".json"]);
364364
this.set("resolveLoader.mainFiles", ["index"]);
365+
this.set("resolveLoader.roots", "make", options => [options.context]);
365366
this.set("resolveLoader.cacheWithContext", "make", options => {
366367
return (
367368
Array.isArray(options.resolveLoader.plugins) &&

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack",
3-
"version": "4.43.0",
3+
"version": "4.44.0",
44
"author": "Tobias Koppers @sokra",
55
"description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
66
"license": "MIT",
@@ -13,7 +13,7 @@
1313
"ajv": "^6.10.2",
1414
"ajv-keywords": "^3.4.1",
1515
"chrome-trace-event": "^1.0.2",
16-
"enhanced-resolve": "^4.1.0",
16+
"enhanced-resolve": "^4.3.0",
1717
"eslint-scope": "^4.0.3",
1818
"json-parse-better-errors": "^1.0.2",
1919
"loader-runner": "^2.4.0",
@@ -26,7 +26,7 @@
2626
"schema-utils": "^1.0.0",
2727
"tapable": "^1.1.3",
2828
"terser-webpack-plugin": "^1.4.3",
29-
"watchpack": "^1.6.1",
29+
"watchpack": "^1.7.4",
3030
"webpack-sources": "^1.4.1"
3131
},
3232
"peerDependenciesMeta": {

schemas/WebpackOptions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,14 @@
12291229
"resolver": {
12301230
"description": "Custom resolver"
12311231
},
1232+
"roots": {
1233+
"description": "A list of directories in which requests that are server-relative URLs (starting with '/') are resolved. On non-windows system these requests are tried to resolve as absolute path first.",
1234+
"type": "array",
1235+
"items": {
1236+
"description": "Directory in which requests that are server-relative URLs (starting with '/') are resolved.",
1237+
"type": "string"
1238+
}
1239+
},
12321240
"symlinks": {
12331241
"description": "Enable resolving symlinks to the original location",
12341242
"type": "boolean"

test/WatchTestCases.test.js

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -308,27 +308,29 @@ describe("WatchTestCases", () => {
308308
new Error("No tests exported by test case")
309309
);
310310

311-
run.it("should compile the next step", done => {
312-
runIdx++;
313-
if (runIdx < runs.length) {
314-
run = runs[runIdx];
315-
waitMode = true;
316-
setTimeout(() => {
317-
waitMode = false;
318-
compilationFinished = done;
319-
currentWatchStepModule.step = run.name;
320-
copyDiff(
321-
path.join(testDirectory, run.name),
322-
tempDirectory,
323-
false
324-
);
325-
}, 1500);
326-
} else {
327-
watching.close();
328-
329-
done();
330-
}
331-
});
311+
run.it(
312+
"should compile the next step",
313+
done => {
314+
runIdx++;
315+
if (runIdx < runs.length) {
316+
run = runs[runIdx];
317+
waitMode = true;
318+
setTimeout(() => {
319+
waitMode = false;
320+
compilationFinished = done;
321+
currentWatchStepModule.step = run.name;
322+
copyDiff(
323+
path.join(testDirectory, run.name),
324+
tempDirectory,
325+
false
326+
);
327+
}, 1500);
328+
} else {
329+
watching.close(done);
330+
}
331+
},
332+
45000
333+
);
332334

333335
compilationFinished();
334336
}

yarn.lock

Lines changed: 104 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,14 @@ anymatch@^2.0.0:
782782
micromatch "^3.1.4"
783783
normalize-path "^2.1.1"
784784

785+
anymatch@~3.1.1:
786+
version "3.1.1"
787+
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142"
788+
integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==
789+
dependencies:
790+
normalize-path "^3.0.0"
791+
picomatch "^2.0.4"
792+
785793
aproba@^1.1.1:
786794
version "1.2.0"
787795
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
@@ -1039,6 +1047,11 @@ binary-extensions@^1.0.0:
10391047
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65"
10401048
integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==
10411049

1050+
binary-extensions@^2.0.0:
1051+
version "2.1.0"
1052+
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9"
1053+
integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==
1054+
10421055
bindings@^1.5.0:
10431056
version "1.5.0"
10441057
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df"
@@ -1096,6 +1109,13 @@ braces@^2.3.1, braces@^2.3.2:
10961109
split-string "^3.0.2"
10971110
to-regex "^3.0.1"
10981111

1112+
braces@~3.0.2:
1113+
version "3.0.2"
1114+
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
1115+
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
1116+
dependencies:
1117+
fill-range "^7.0.1"
1118+
10991119
brorand@^1.0.1:
11001120
version "1.1.0"
11011121
resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
@@ -1361,6 +1381,21 @@ chokidar@^2.1.8:
13611381
optionalDependencies:
13621382
fsevents "^1.2.7"
13631383

1384+
chokidar@^3.4.1:
1385+
version "3.4.1"
1386+
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.1.tgz#e905bdecf10eaa0a0b1db0c664481cc4cbc22ba1"
1387+
integrity sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g==
1388+
dependencies:
1389+
anymatch "~3.1.1"
1390+
braces "~3.0.2"
1391+
glob-parent "~5.1.0"
1392+
is-binary-path "~2.1.0"
1393+
is-glob "~4.0.1"
1394+
normalize-path "~3.0.0"
1395+
readdirp "~3.4.0"
1396+
optionalDependencies:
1397+
fsevents "~2.1.2"
1398+
13641399
chownr@^1.1.1:
13651400
version "1.1.3"
13661401
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.3.tgz#42d837d5239688d55f303003a508230fa6727142"
@@ -1980,10 +2015,10 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0:
19802015
dependencies:
19812016
once "^1.4.0"
19822017

1983-
enhanced-resolve@^4.1.0:
1984-
version "4.1.1"
1985-
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.1.tgz#2937e2b8066cd0fe7ce0990a98f0d71a35189f66"
1986-
integrity sha512-98p2zE+rL7/g/DzMHMTF4zZlCgeVdJ7yr6xzEpJRYwFYrGi9ANdn5DnJURg6RpBkyk60XYDnWIv51VfIhfNGuA==
2018+
enhanced-resolve@^4.3.0:
2019+
version "4.3.0"
2020+
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz#3b806f3bfafc1ec7de69551ef93cca46c1704126"
2021+
integrity sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==
19872022
dependencies:
19882023
graceful-fs "^4.1.2"
19892024
memory-fs "^0.5.0"
@@ -2519,6 +2554,13 @@ fill-range@^4.0.0:
25192554
repeat-string "^1.6.1"
25202555
to-regex-range "^2.1.0"
25212556

2557+
fill-range@^7.0.1:
2558+
version "7.0.1"
2559+
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
2560+
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
2561+
dependencies:
2562+
to-regex-range "^5.0.1"
2563+
25222564
finalhandler@1.1.1:
25232565
version "1.1.1"
25242566
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105"
@@ -2647,6 +2689,11 @@ fsevents@^1.2.7:
26472689
bindings "^1.5.0"
26482690
nan "^2.12.1"
26492691

2692+
fsevents@~2.1.2:
2693+
version "2.1.3"
2694+
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e"
2695+
integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==
2696+
26502697
function-bind@^1.1.1:
26512698
version "1.1.1"
26522699
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
@@ -2708,6 +2755,13 @@ glob-parent@^3.1.0:
27082755
is-glob "^3.1.0"
27092756
path-dirname "^1.0.0"
27102757

2758+
glob-parent@~5.1.0:
2759+
version "5.1.1"
2760+
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229"
2761+
integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==
2762+
dependencies:
2763+
is-glob "^4.0.1"
2764+
27112765
glob@^5.0.15:
27122766
version "5.0.15"
27132767
resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1"
@@ -3098,6 +3152,13 @@ is-binary-path@^1.0.0:
30983152
dependencies:
30993153
binary-extensions "^1.0.0"
31003154

3155+
is-binary-path@~2.1.0:
3156+
version "2.1.0"
3157+
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
3158+
integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
3159+
dependencies:
3160+
binary-extensions "^2.0.0"
3161+
31013162
is-buffer@^1.1.5:
31023163
version "1.1.6"
31033164
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
@@ -3206,7 +3267,7 @@ is-glob@^3.1.0:
32063267
dependencies:
32073268
is-extglob "^2.1.0"
32083269

3209-
is-glob@^4.0.0:
3270+
is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1:
32103271
version "4.0.1"
32113272
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc"
32123273
integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==
@@ -3220,6 +3281,11 @@ is-number@^3.0.0:
32203281
dependencies:
32213282
kind-of "^3.0.2"
32223283

3284+
is-number@^7.0.0:
3285+
version "7.0.0"
3286+
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
3287+
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
3288+
32233289
is-obj@^1.0.1:
32243290
version "1.0.1"
32253291
resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f"
@@ -4551,7 +4617,7 @@ normalize-path@^2.1.1:
45514617
dependencies:
45524618
remove-trailing-separator "^1.0.1"
45534619

4554-
normalize-path@^3.0.0:
4620+
normalize-path@^3.0.0, normalize-path@~3.0.0:
45554621
version "3.0.0"
45564622
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
45574623
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
@@ -4878,6 +4944,11 @@ performance-now@^2.1.0:
48784944
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
48794945
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
48804946

4947+
picomatch@^2.0.4, picomatch@^2.2.1:
4948+
version "2.2.2"
4949+
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
4950+
integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
4951+
48814952
pify@^2.0.0:
48824953
version "2.3.0"
48834954
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
@@ -5386,6 +5457,13 @@ readdirp@^2.2.1:
53865457
micromatch "^3.1.10"
53875458
readable-stream "^2.0.2"
53885459

5460+
readdirp@~3.4.0:
5461+
version "3.4.0"
5462+
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.4.0.tgz#9fdccdf9e9155805449221ac645e8303ab5b9ada"
5463+
integrity sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==
5464+
dependencies:
5465+
picomatch "^2.2.1"
5466+
53895467
realpath-native@^1.1.0:
53905468
version "1.1.0"
53915469
resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c"
@@ -6321,6 +6399,13 @@ to-regex-range@^2.1.0:
63216399
is-number "^3.0.0"
63226400
repeat-string "^1.6.1"
63236401

6402+
to-regex-range@^5.0.1:
6403+
version "5.0.1"
6404+
resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
6405+
integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
6406+
dependencies:
6407+
is-number "^7.0.0"
6408+
63246409
to-regex@^3.0.1, to-regex@^3.0.2:
63256410
version "3.0.2"
63266411
resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce"
@@ -6628,14 +6713,23 @@ wast-loader@^1.5.5:
66286713
dependencies:
66296714
wabt "1.0.0-nightly.20180421"
66306715

6631-
watchpack@^1.6.1:
6632-
version "1.6.1"
6633-
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.1.tgz#280da0a8718592174010c078c7585a74cd8cd0e2"
6634-
integrity sha512-+IF9hfUFOrYOOaKyfaI7h7dquUIOgyEMoQMLA7OP5FxegKA2+XdXThAZ9TU2kucfhDH7rfMHs1oPYziVGWRnZA==
6716+
watchpack-chokidar2@^2.0.0:
6717+
version "2.0.0"
6718+
resolved "https://registry.yarnpkg.com/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz#9948a1866cbbd6cb824dea13a7ed691f6c8ddff0"
6719+
integrity sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA==
66356720
dependencies:
66366721
chokidar "^2.1.8"
6722+
6723+
watchpack@^1.7.4:
6724+
version "1.7.4"
6725+
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.7.4.tgz#6e9da53b3c80bb2d6508188f5b200410866cd30b"
6726+
integrity sha512-aWAgTW4MoSJzZPAicljkO1hsi1oKj/RRq/OJQh2PKI2UKL04c2Bs+MBOB+BBABHTXJpf9mCwHN7ANCvYsvY2sg==
6727+
dependencies:
66376728
graceful-fs "^4.1.2"
66386729
neo-async "^2.5.0"
6730+
optionalDependencies:
6731+
chokidar "^3.4.1"
6732+
watchpack-chokidar2 "^2.0.0"
66396733

66406734
webassembly-feature@1.3.0:
66416735
version "1.3.0"

0 commit comments

Comments
 (0)