Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit 76fb29e

Browse files
committed
Use url-parse for node 6 support
1 parent 34fd443 commit 76fb29e

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

package-lock.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"webpack": ">=3.2.0"
5555
},
5656
"dependencies": {
57-
"@babel/runtime": "^7.0.0-beta.49"
57+
"@babel/runtime": "^7.0.0-beta.49",
58+
"url-parse": "^1.4.1"
5859
}
5960
}

src/lib/determine-as-value.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
const assert = require('assert');
1919
const path = require('path');
20-
const {URL} = require('url');
20+
// The first-party 'url' module isn't available in node 6.
21+
const URL = require('url-parse');
2122

2223
function determineAsValue({optionsAs, href}) {
2324
assert(href, `The 'href' parameter was not provided.`);

src/lib/extract-chunks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function extractChunks({compilation, optionsInclude}) {
1919
try {
2020
// 'asyncChunks' are chunks intended for lazy/async loading usually generated as
2121
// part of code-splitting with import() or require.ensure(). By default, asyncChunks
22-
// get wired up using link rel=preload when using this plugin. This behaviour can be
22+
// get wired up using link rel=preload when using this plugin. This behavior can be
2323
// configured to preload all types of chunks or just prefetch chunks as needed.
2424
if (optionsInclude === undefined || optionsInclude === 'asyncChunks') {
2525
return compilation.chunks.filter(chunk => {

0 commit comments

Comments
 (0)