Skip to content

Commit

Permalink
fix: update with core
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedAlchemy committed Apr 1, 2020
1 parent c986d78 commit 3246bc2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
22 changes: 11 additions & 11 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class ExtractCssChunksPlugin {
if (typeof chunkMaps.hash[chunkId] === 'string') {
shortChunkHashMap[chunkId] = chunkMaps.hash[
chunkId
].substring(0, length);
].substring(0, length);
}
}

Expand All @@ -306,7 +306,7 @@ class ExtractCssChunksPlugin {
if (typeof contentHash[chunkId] === 'string') {
shortContentHashMap[chunkId] = contentHash[
chunkId
].substring(0, length);
].substring(0, length);
}
}

Expand Down Expand Up @@ -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);'
Expand Down Expand Up @@ -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');
Expand Down
14 changes: 7 additions & 7 deletions src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})});
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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}`;
Expand Down

0 comments on commit 3246bc2

Please sign in to comment.