script-ext-html-webpack-plugin
Advanced tools
Comparing version 1.8.2 to 1.8.3
@@ -37,10 +37,7 @@ 'use strict'; | ||
const publicPath = getPublicPath(options); | ||
if (publicPath) { | ||
const prefix = publicPath.endsWith('/') ? publicPath : publicPath + '/'; | ||
return file => prefix + file; | ||
} else { | ||
return file => file; | ||
} | ||
return publicPath | ||
? file => publicPath + file | ||
: file => file; | ||
}; | ||
module.exports = addAsyncChunkResourceHints; |
'use strict'; | ||
const debug = require('debug')('ScriptExt'); | ||
const separator = require('path').sep; | ||
@@ -11,6 +12,11 @@ const isScript = (tag) => tag.tagName === 'script'; | ||
const getPublicPath = options => | ||
(options.compilationOptions.output && options.compilationOptions.output.publicPath) | ||
? options.compilationOptions.output.publicPath | ||
: undefined; | ||
const getPublicPath = options => { | ||
const output = options.compilationOptions.output; | ||
if (output) { | ||
let publicPath = output.publicPath; | ||
if (publicPath) { | ||
return publicPath.endsWith(separator) ? publicPath : publicPath + separator; | ||
} | ||
} | ||
}; | ||
@@ -17,0 +23,0 @@ const getScriptName = (options, tag) => { |
{ | ||
"name": "script-ext-html-webpack-plugin", | ||
"version": "1.8.2", | ||
"version": "1.8.3", | ||
"description": "Enhances html-webpack-plugin functionality with async and defer attributes for script elements", | ||
@@ -12,7 +12,8 @@ "main": "index.js", | ||
"pretest": "semistandard & install-module-versions dynavers.json", | ||
"test": "VERSION=webpack1 jasmine && VERSION=webpack2 jasmine", | ||
"test": "VERSION=webpack1 jasmine && VERSION=webpack2 jasmine && VERSION=webpack3 jasmine", | ||
"test:webpack1": "VERSION=webpack1 jasmine", | ||
"test:webpack2": "VERSION=webpack2 jasmine", | ||
"debug": "DEBUG=ScriptExt VERSION=webpack2 jasmine", | ||
"node-debug": "DEBUG=ScriptExt VERSION=webpack1 node-debug jasmine" | ||
"test:webpack3": "VERSION=webpack3 jasmine", | ||
"debug": "DEBUG=ScriptExt VERSION=webpack3 jasmine", | ||
"node-debug": "DEBUG=ScriptExt VERSION=webpack3 node-debug jasmine" | ||
}, | ||
@@ -19,0 +20,0 @@ "repository": { |
@@ -294,3 +294,4 @@ Script Extension for HTML Webpack Plugin | ||
* compatible with [webpack-config](https://www.npmjs.com/package/webpack-config) - thank s @avaly | ||
* node v8+ testing | ||
* node v8+ and webback 3.x testing | ||
* resource hints handle public paths without end separators (thanks @albv) | ||
@@ -297,0 +298,0 @@ v1.7.x |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29905
426
333