alloy-loader
Advanced tools
Comparing version 0.2.7 to 0.2.8
@@ -35,5 +35,2 @@ /* eslint-disable no-unreachable */ | ||
if (entryRegex.test(this.resourcePath)) { | ||
return entryLoader.call(this, content); | ||
} | ||
if (internalsRegex.test(this.resourcePath)) { | ||
@@ -48,2 +45,5 @@ return internalsLoader.call(this, content); | ||
} | ||
if (entryRegex.test(this.resourcePath)) { | ||
return entryLoader.call(this, content); | ||
} | ||
@@ -50,0 +50,0 @@ return [ content ]; |
@@ -57,16 +57,7 @@ const { utils: { XML } } = require('alloy-utils'); | ||
compilation.hooks.additionalAssets.tap('AlloyI18nPlugin', () => { | ||
const emitAsset = (targetFile, content) => { | ||
const targetPath = compiler.outputFileSystem.join( | ||
outputPath, | ||
targetFile | ||
); | ||
const source = new RawSource(content); | ||
if (currentAssets.get(targetPath) === content) { | ||
// set `existsAt` so Webpack 4 will skip emitting this asset | ||
source.existsAt = targetPath; | ||
} | ||
const emitAsset = (targetFile, asset) => { | ||
if (typeof compilation.emitAsset === 'function') { | ||
compilation.emitAsset(targetFile, source); | ||
compilation.emitAsset(targetFile, asset); | ||
} else { | ||
compilation.assets[targetFile] = source; | ||
compilation.assets[targetFile] = asset; | ||
} | ||
@@ -76,7 +67,7 @@ }; | ||
if (!firstCompilation && !i18nFileChanged) { | ||
// if no i18n files where changed in a subsequent watch compilation, | ||
// if no i18n files where changed in subsequent compilations, | ||
// just add back the current assets | ||
currentAssets.forEach( | ||
(content, filePathAndName) => emitAsset( | ||
path.relative(outputPath, filePathAndName), content | ||
(asset, filePathAndName) => emitAsset( | ||
path.relative(outputPath, filePathAndName), asset | ||
) | ||
@@ -103,4 +94,5 @@ ); | ||
); | ||
emitAsset(targetFile, xmlContent); | ||
currentAssets.set(targetPath, content); | ||
const asset = new RawSource(xmlContent); | ||
emitAsset(targetFile, asset); | ||
currentAssets.set(targetPath, asset); | ||
}); | ||
@@ -107,0 +99,0 @@ }); |
{ | ||
"name": "alloy-loader", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"description": "Webpack loader for Alloy components", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
31023
524