wext-manifest-loader
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -1,1 +0,1 @@ | ||
export declare function loader(context: any, source: any): void; | ||
export declare function loader(this: any, source: any): string; |
@@ -64,8 +64,8 @@ "use strict"; | ||
}; | ||
function loader(context, source) { | ||
if (context.cacheable) { | ||
context.cacheable(); | ||
function loader(source) { | ||
if (this.cacheable) { | ||
this.cacheable(); | ||
} | ||
context.addDependency(packageJSONPath); | ||
const options = loader_utils_1.getOptions(context); | ||
this.addDependency(packageJSONPath); | ||
const options = loader_utils_1.getOptions(this); | ||
schema_utils_1.default(schema, options, { | ||
@@ -81,3 +81,3 @@ name: 'Wext Manifest Loader', | ||
catch (err) { | ||
context.emitError(err); | ||
this.emitError(err); | ||
} | ||
@@ -88,7 +88,7 @@ } | ||
if (browserVendors.indexOf(vendor) < 0) { | ||
return context.emitError(`${LOADER_NAME}: browser ${vendor} is not supported`); | ||
return this.emitError(`${LOADER_NAME}: browser ${vendor} is not supported`); | ||
} | ||
} | ||
else { | ||
return context.emitError(`${LOADER_NAME}: TARGET_BROWSER variable missing`); | ||
return this.emitError(`${LOADER_NAME}: TARGET_BROWSER variable missing`); | ||
} | ||
@@ -102,13 +102,15 @@ const manifest = transformVendorKeys(content, vendor); | ||
catch (err) { | ||
context.emitError(err); | ||
this.emitError(err); | ||
} | ||
} | ||
const outputPath = loader_utils_1.interpolateName(context, 'manifest.json', { | ||
const outputPath = loader_utils_1.interpolateName(this, 'manifest.json', { | ||
source, | ||
}); | ||
const publicPath = `__webpack_public_path__ + ${JSON.stringify(outputPath)}`; | ||
const formattedJson = JSON.stringify(manifest, null, 2) | ||
.replace(/\u2028/g, '\\u2028') | ||
.replace(/\u2029/g, '\\u2029'); | ||
context.emitFile(outputPath, formattedJson); | ||
this.emitFile(outputPath, formattedJson); | ||
return `module.exports = ${publicPath};`; | ||
} | ||
exports.loader = loader; |
{ | ||
"name": "wext-manifest-loader", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Webpack loader that lets you specify `manifest.json` properties to appear only in specific browsers.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
12808
121