wext-manifest-loader
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -1,1 +0,1 @@ | ||
export declare function loader(source: any): string | Error; | ||
export declare function loader(context: any, source: any): void; |
@@ -64,12 +64,12 @@ "use strict"; | ||
}; | ||
function loader(source) { | ||
if (this.cacheable) { | ||
this.cacheable(); | ||
function loader(context, source) { | ||
if (context.cacheable) { | ||
context.cacheable(); | ||
} | ||
this.addDependency(packageJSONPath); | ||
const options = loader_utils_1.getOptions(this); | ||
context.addDependency(packageJSONPath); | ||
const options = loader_utils_1.getOptions(context); | ||
schema_utils_1.default(schema, options, { | ||
name: 'Wext Manifest Loader', | ||
}); | ||
const usePackageJSONVersion = options.usePackageJSONVersion || false; | ||
const usePackageJSONVersion = (options.usePackageJSONVersion && true) || false; | ||
let content = {}; | ||
@@ -81,3 +81,3 @@ if (typeof source === 'string') { | ||
catch (err) { | ||
this.emitError(err instanceof Error ? err : new Error(err)); | ||
context.emitError(err); | ||
} | ||
@@ -88,7 +88,7 @@ } | ||
if (browserVendors.indexOf(vendor) < 0) { | ||
this.emitError(new Error(`${LOADER_NAME}: browser ${vendor} is not supported`)); | ||
return context.emitError(`${LOADER_NAME}: browser ${vendor} is not supported`); | ||
} | ||
} | ||
else { | ||
this.emitError(new Error(`${LOADER_NAME}: TARGET_BROWSER variable missing`)); | ||
return context.emitError(`${LOADER_NAME}: TARGET_BROWSER variable missing`); | ||
} | ||
@@ -102,13 +102,13 @@ const manifest = transformVendorKeys(content, vendor); | ||
catch (err) { | ||
this.emitError(err instanceof Error ? err : new Error(err)); | ||
context.emitError(err); | ||
} | ||
} | ||
const outputPath = loader_utils_1.interpolateName(this, 'manifest.json', { source }); | ||
const publicPath = `__webpack_public_path__ + ${JSON.stringify(outputPath)}`; | ||
const outputPath = loader_utils_1.interpolateName(context, 'manifest.json', { | ||
source, | ||
}); | ||
const formattedJson = JSON.stringify(manifest, null, 2) | ||
.replace(/\u2028/g, '\\u2028') | ||
.replace(/\u2029/g, '\\u2029'); | ||
this.emitFile(outputPath, formattedJson); | ||
return `module.exports = ${publicPath};`; | ||
context.emitFile(outputPath, formattedJson); | ||
} | ||
exports.loader = loader; |
{ | ||
"name": "wext-manifest-loader", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Webpack loader that lets you specify `manifest.json` properties to appear only in specific browsers.", | ||
@@ -41,24 +41,24 @@ "license": "MIT", | ||
"loader-utils": "^2.0.0", | ||
"schema-utils": "^2.6.6" | ||
"schema-utils": "^2.7.0" | ||
}, | ||
"devDependencies": { | ||
"@abhijithvijayan/eslint-config": "^1.4.0", | ||
"@abhijithvijayan/tsconfig": "^1.1.2", | ||
"@types/loader-utils": "^1.1.3", | ||
"@types/node": "^14.0.4", | ||
"@typescript-eslint/eslint-plugin": "^2.34.0", | ||
"@typescript-eslint/parser": "^2.34.0", | ||
"@abhijithvijayan/eslint-config": "^1.4.1", | ||
"@abhijithvijayan/tsconfig": "^1.2.0", | ||
"@types/loader-utils": "^2.0.1", | ||
"@types/node": "^14.0.14", | ||
"@typescript-eslint/eslint-plugin": "^3.5.0", | ||
"@typescript-eslint/parser": "^3.5.0", | ||
"babel-eslint": "^10.1.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-airbnb": "^18.1.0", | ||
"eslint-config-airbnb": "^18.2.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-import": "^2.20.2", | ||
"eslint-plugin-jsx-a11y": "^6.2.3", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"eslint-plugin-react": "^7.20.0", | ||
"eslint-plugin-react-hooks": "^4.0.2", | ||
"eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-jsx-a11y": "^6.3.1", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"eslint-plugin-react": "^7.20.3", | ||
"eslint-plugin-react-hooks": "^4.0.5", | ||
"prettier": "^2.0.5", | ||
"rimraf": "^3.0.2", | ||
"typescript": "^3.9.3" | ||
"typescript": "^3.9.6" | ||
} | ||
} |
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
12720
Updatedschema-utils@^2.7.0