miikemccabe / chem-loader

A Webpack loader for loading Chrome Extension manifest files using information from package.json

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chem-loader (CHrome Extension Manifest Loader)

chem-loader is a webpack loader for developing Chrome Extensions. It takes your manifest file and sets the version to the same as your project's package.json. This means you don't need to keep them both in sync.

The loader also gives you the option of using the name, description and author from your project's package.json.

This loader does not write the output to file. You're expected to pass the results of this loader to a file-writing loader such as file-loader

How to use

Installation

npm install chem-loader --save-dev

Require or import your manifest.json

require('file?name=[name].json!chem-loader?useDescription=true&useAuthor=true!./src/manifest.json');

or

import 'file?name=[name].json!chem-loader?useDescription=true&useAuthor=true!./src/manifest.json';

Options

If the loader is used without any options, only the version of your manifest file is altered. Pass the following options to the loader if you want to use your project's package.json's name, author or desciption in the manifest.

  • useDescription=true
  • useAuthor=true
  • useName=true

About

A Webpack loader for loading Chrome Extension manifest files using information from package.json


Languages

Language:JavaScript 100.0%