wext-manifest-webpack-plugin
    TypeScript icon, indicating that this package has built-in type declarations

    1.2.1 • Public • Published

    wext-manifest-webpack-plugin

    Webpack plugin to solve the problem of generating js file for manifest.json entry

    🙋‍♂️ Made by @abhijithvijayan

    Donate: PayPal, Patreon

    Buy Me a Coffee


    ❤️ it? ⭐️ it on GitHub or Tweet about it.

    Table of Contents

    How it works

    It just find js files from manifest entry and remove the js file from the compilation.

    Looking for Web Extension starter

    Checkout web-extension-starter that uses this plugin

    Installation

    # npm 
    npm install --save-dev wext-manifest-webpack-plugin
     
    # yarn 
    yarn add wext-manifest-webpack-plugin --dev

    Usage

    // ... other plugins
    const WextManifestWebpackPlugin = require("wext-manifest-webpack-plugin");
     
    module.exports = {
        entry: {
            manifest: './source/manifest.json',
            // ...
        },
     
        output: {
            path: path.join(destPath, targetBrowser),
            filename: 'js/[name].js',
        },
     
        module: {
            rules: [
                {
                    type: 'javascript/auto', // prevent webpack handling json with its own loaders,
                    test: /manifest\.json$/,
                    use: 'wext-manifest-loader',
                    exclude: /node_modules/,
                },
            ]
        },
     
        plugins: [
            new WextManifestWebpackPlugin(),
            // ...
        ],
    };

    Issues

    Looking to contribute? Look for the Good First Issue label.

    🐛 Bugs

    Please file an issue here for bugs, missing documentation, or unexpected behavior.

    See Bugs

    Linting & TypeScript Config

    License

    MIT © Abhijith Vijayan

    Install

    npm i wext-manifest-webpack-plugin

    DownloadsWeekly Downloads

    1,607

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    10.5 kB

    Total Files

    7

    Last publish

    Collaborators

    • abhijithvijayan