diff --git a/src/index.js b/src/index.js index bc4041df..9c5bfb38 100644 --- a/src/index.js +++ b/src/index.js @@ -284,7 +284,7 @@ class ExtractCssChunksPlugin { if (typeof chunkMaps.hash[chunkId] === 'string') { shortChunkHashMap[chunkId] = chunkMaps.hash[ chunkId - ].substring(0, length); + ].substring(0, length); } } @@ -306,7 +306,7 @@ class ExtractCssChunksPlugin { if (typeof contentHash[chunkId] === 'string') { shortContentHashMap[chunkId] = contentHash[ chunkId - ].substring(0, length); + ].substring(0, length); } } @@ -369,14 +369,14 @@ class ExtractCssChunksPlugin { 'linkTag.href = fullhref;', crossOriginLoading ? Template.asString([ - `if (linkTag.href.indexOf(window.location.origin + '/') !== 0) {`, - Template.indent( - `linkTag.crossOrigin = ${JSON.stringify( - crossOriginLoading - )};` - ), - '}', - ]) + `if (linkTag.href.indexOf(window.location.origin + '/') !== 0) {`, + Template.indent( + `linkTag.crossOrigin = ${JSON.stringify( + crossOriginLoading + )};` + ), + '}', + ]) : '', insert ? 'insert(linkTag);' @@ -524,7 +524,7 @@ class ExtractCssChunksPlugin { ` * ${m.readableIdentifier(requestShortener)}`, ` - couldn't fulfill desired order of chunk group(s) ${failedChunkGroups}`, goodChunkGroups && - ` - while fulfilling desired order of chunk group(s) ${goodChunkGroups}`, + ` - while fulfilling desired order of chunk group(s) ${goodChunkGroups}`, ] .filter(Boolean) .join('\n'); diff --git a/src/loader.js b/src/loader.js index 205b31af..07ac39c0 100644 --- a/src/loader.js +++ b/src/loader.js @@ -25,9 +25,9 @@ function hotLoader(content, context) { if(module.hot) { // ${Date.now()} var cssReload = require(${loaderUtils.stringifyRequest( - context.context, - path.join(__dirname, 'hmr/hotModuleReplacement.js') - )})(module.id, ${JSON.stringify({ + context.context, + path.join(__dirname, 'hmr/hotModuleReplacement.js') + )})(module.id, ${JSON.stringify({ ...context.options, locals: !!context.locals, })}); @@ -70,8 +70,8 @@ export function pitch(request) { const publicPath = typeof options.publicPath === 'string' ? options.publicPath === '' || options.publicPath.endsWith('/') - ? options.publicPath - : `${options.publicPath}/` + ? options.publicPath + : `${options.publicPath}/` : typeof options.publicPath === 'function' ? options.publicPath(this.resourcePath, this.rootContext) : this._compilation.outputOptions.publicPath; @@ -207,8 +207,8 @@ export function pitch(request) { typeof options.esModule !== 'undefined' ? options.esModule : false; const result = locals ? `\n${esModule ? 'export default' : 'module.exports ='} ${JSON.stringify( - locals - )};` + locals + )};` : ''; let resultSource = `// extracted by ${pluginName}`;