Skip to content

Commit 008ac78

Browse files
authored
Merge pull request webpack#5353 from webpack/deps/extract-text-webpack-plugin
upgrade extract-text-webpack-plugin
2 parents ee358bd + 838d416 commit 008ac78

7 files changed

Lines changed: 26 additions & 24 deletions

File tree

lib/Stats.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
const RequestShortener = require("./RequestShortener");
88
const SizeFormatHelpers = require("./SizeFormatHelpers");
99
const formatLocation = require("./formatLocation");
10+
const identifierUtils = require("./util/identifier");
1011

1112
const optionOrFallback = (optionValue, fallbackValue) => typeof optionValue !== "undefined" ? optionValue : fallbackValue;
1213

@@ -80,7 +81,8 @@ class Stats {
8081
typeof options.all !== "undefined" ? options.all : def;
8182

8283
const compilation = this.compilation;
83-
const requestShortener = new RequestShortener(optionOrFallback(options.context, process.cwd()));
84+
const context = optionOrFallback(options.context, process.cwd());
85+
const requestShortener = new RequestShortener(context);
8486
const showPerformance = optionOrLocalFallback(options.performance, true);
8587
const showHash = optionOrLocalFallback(options.hash, true);
8688
const showVersion = optionOrLocalFallback(options.version, true);
@@ -391,7 +393,8 @@ class Stats {
391393
const obj = new Stats(child).toJson(childOptions, forToString);
392394
delete obj.hash;
393395
delete obj.version;
394-
obj.name = child.name;
396+
if(child.name)
397+
obj.name = identifierUtils.makePathsRelative(context, child.name, compilation.cache);
395398
return obj;
396399
});
397400
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"eslint": "^4.3.0",
4343
"eslint-plugin-node": "^5.1.1",
4444
"express": "~4.13.1",
45-
"extract-text-webpack-plugin": "^2.0.0-beta",
45+
"extract-text-webpack-plugin": "^3.0.0",
4646
"file-loader": "^0.11.2",
4747
"i18n-webpack-plugin": "^1.0.0",
4848
"istanbul": "^0.4.5",

test/HotTestCases.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe("HotTestCases", () => {
5353
test: /\.css$/,
5454
use: ExtractTextPlugin.extract({
5555
fallback: "style-loader",
56-
loader: "css-loader"
56+
use: "css-loader"
5757
})
5858
}]
5959
},

test/statsCases/separate-css-bundle/expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Child
1111
[3] (webpack)/node_modules/css-loader/lib/css-base.js 2.26 kB [built]
1212
[4] (webpack)/node_modules/style-loader/lib/addStyles.js 8.66 kB [built]
1313
[5] (webpack)/node_modules/style-loader/lib/urls.js 3.01 kB [built]
14-
Child extract-text-webpack-plugin:
14+
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js!test/statsCases/separate-css-bundle/a/file.css:
1515
[0] (webpack)/node_modules/css-loader!(webpack)/test/statsCases/separate-css-bundle/a/file.css 199 bytes {0} [built]
1616
[1] (webpack)/node_modules/css-loader/lib/css-base.js 2.26 kB {0} [built]
1717
Child
@@ -26,6 +26,6 @@ Child
2626
[3] (webpack)/node_modules/css-loader/lib/css-base.js 2.26 kB [built]
2727
[4] (webpack)/node_modules/style-loader/lib/addStyles.js 8.66 kB [built]
2828
[5] (webpack)/node_modules/style-loader/lib/urls.js 3.01 kB [built]
29-
Child extract-text-webpack-plugin:
29+
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js!test/statsCases/separate-css-bundle/b/file.css:
3030
[0] (webpack)/node_modules/css-loader!(webpack)/test/statsCases/separate-css-bundle/b/file.css 201 bytes {0} [built]
3131
[1] (webpack)/node_modules/css-loader/lib/css-base.js 2.26 kB {0} [built]

test/statsCases/separate-css-bundle/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var moduleConfig = {
77
test: /\.css$/,
88
use: ExtractTextPlugin.extract({
99
fallback: "style-loader",
10-
loader: "css-loader"
10+
use: "css-loader"
1111
})
1212
}
1313
]

test/watchCases/plugins/extract-text-plugin/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
{
77
test: /\.css$/,
88
loader: ExtractTextPlugin.extract({
9-
loader: "css-loader"
9+
use: "css-loader"
1010
})
1111
}
1212
]

yarn.lock

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ ajv-keywords@^2.0.0:
6666
version "2.0.0"
6767
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.0.0.tgz#a37d02f845b6f52569804164270b24cb6c6cee61"
6868

69-
ajv@^4.11.2, ajv@^4.7.0, ajv@^4.9.1:
69+
ajv@^4.7.0, ajv@^4.9.1:
7070
version "4.11.8"
7171
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536"
7272
dependencies:
@@ -239,6 +239,12 @@ async@^2.1.2:
239239
dependencies:
240240
lodash "^4.14.0"
241241

242+
async@^2.4.1:
243+
version "2.5.0"
244+
resolved "https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d"
245+
dependencies:
246+
lodash "^4.14.0"
247+
242248
async@~0.9.0:
243249
version "0.9.2"
244250
resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d"
@@ -1436,14 +1442,14 @@ extglob@^0.3.1:
14361442
dependencies:
14371443
is-extglob "^1.0.0"
14381444

1439-
extract-text-webpack-plugin@^2.0.0-beta:
1440-
version "2.1.0"
1441-
resolved "https://registry.yarnpkg.com/extract-text-webpack-plugin/-/extract-text-webpack-plugin-2.1.0.tgz#69315b885f876dbf96d3819f6a9f1cca7aebf159"
1445+
extract-text-webpack-plugin@^3.0.0:
1446+
version "3.0.0"
1447+
resolved "https://registry.yarnpkg.com/extract-text-webpack-plugin/-/extract-text-webpack-plugin-3.0.0.tgz#90caa7907bc449f335005e3ac7532b41b00de612"
14421448
dependencies:
1443-
ajv "^4.11.2"
1444-
async "^2.1.2"
1445-
loader-utils "^1.0.2"
1446-
webpack-sources "^0.1.0"
1449+
async "^2.4.1"
1450+
loader-utils "^1.1.0"
1451+
schema-utils "^0.3.0"
1452+
webpack-sources "^1.0.1"
14471453

14481454
extsprintf@1.0.2:
14491455
version "1.0.2"
@@ -3859,7 +3865,7 @@ sort-keys@^1.0.0:
38593865
dependencies:
38603866
is-plain-obj "^1.0.0"
38613867

3862-
source-list-map@^0.1.7, source-list-map@~0.1.7:
3868+
source-list-map@^0.1.7:
38633869
version "0.1.8"
38643870
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.8.tgz#c550b2ab5427f6b3f21f5afead88c4f5587b2106"
38653871

@@ -4355,13 +4361,6 @@ webpack-dev-middleware@^1.9.0:
43554361
path-is-absolute "^1.0.0"
43564362
range-parser "^1.0.3"
43574363

4358-
webpack-sources@^0.1.0:
4359-
version "0.1.5"
4360-
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.1.5.tgz#aa1f3abf0f0d74db7111c40e500b84f966640750"
4361-
dependencies:
4362-
source-list-map "~0.1.7"
4363-
source-map "~0.5.3"
4364-
43654364
webpack-sources@^1.0.1:
43664365
version "1.0.1"
43674366
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.0.1.tgz#c7356436a4d13123be2e2426a05d1dad9cbe65cf"

0 commit comments

Comments
 (0)