Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
jsn-webpack-extension-manifest-plugin
Advanced tools
Plugin simplifies the development of browser extensions
Plugin simplifies the development of browser extensions
npm i -D jsn-webpack-extension-manifest-plugin
This plugin allows to use in chrome extension's manifest.json file paths to resources with prefixes @ and @!.
Prefix @ will be resolved during webpack compilation to resource path loaded with file-loader.
Prefix @! will be resolved during webpack compilation to compiled chunk path.
Project structure:
Webpack config:
module.exports = {
entry: {
helloworld: 'src/hello_world.js'
},
output: {
filename: 'js/[name].build.js',
path: path.resolve(__dirname, 'build')
},
module: {
rules: [
{test: /src\/client\/.+\.js$/, use: 'file-loader'}
]
},
plugins: [
new JsnWebpackExtensionManifestPlugin({
manifest: path.resolve(__dirname, 'manifest.json'),
outputFilename: 'manifest.json',
useLoader: false
})
]
};
Manifest:
{
"background": [
"@!helloworld"
],
"web_accessible_resources": [
"@src/client/client-script.js"
]
}
After compilation manifest will be placed to build directory and resources prefixed with @ or @! will be replaced.
Result manifest.json
{
"background": [
"js/helloworld.build.js"
],
"web_accessible_resources": [
"js/client/c265935b2ca8ab17df005645b08b714c.js"
]
}
Option | Type | Allowed values | Default value | Description |
---|---|---|---|---|
name (optional) | string | * | Name of the plugin instance (this will be used to name intermediate js file) | |
manifest (required) | string | * | Absolute path to the manifest file | |
entryName (optional) | string | * | manifest.json | Entry name for child compiler |
outputFilename (optional) | string | * | manifest.json | Path to the output manifest file relative to output.path of main compiler |
useLoader (optional) | boolean | true, false | true | By default plugin will use file-loader to load all files, but if you already configured loaders for files that will be stated in manifest - you may want to disable this option |
merge (optional) | object, object[] | * | {} | Fields that will be merged into manifest. Make sure that you DO NOT use prefixed with @ or @! paths to resources, because they WILL NOT be processed. If you want to merge into the manifest more than one object - you can pass to this property array of objects |
FAQs
Plugin simplifies the development of browser extensions
We found that jsn-webpack-extension-manifest-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.