New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tampermonkey-webpack-template

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tampermonkey-webpack-template

a-simple-template-for-tampermonkey

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

tampermonkey-webpack-template

This is a template for the webpack plugin html-webpack-plugin. Its usful for you to develop tampermonkey userscripts.

Oh, pls use cdn.

Templates for the html-webpack-plugin are implemented using underscore templates (previously, in 2.x, blueimp templates). You can write your own as well.

Installation

Install the template in your project with npm:

$ npm install tampermonkey-webpack-template --save-dev

Basic Usage

To make it work, you need to provide these required parameters:

  • inject: false
  • template: require('tampermonkey-webpack-template')

And you can provide some other optional parameters:

  • scriptName: The name of your tampermonkey script.
  • namespace: Same as namespace field in tampermonkey script.
  • version: Same as version field in tampermonkey script.
  • description: Same as description field in tampermonkey script.
  • author: Same as author field in tampermonkey script.
  • include: Same as include field in tampermonkey script.
  • exclude: Same as exclude field in tampermonkey script.
  • match: Same as match field in tampermonkey script.

otherwise available.

Example

Here's an example webpack config illustrating how to use these options in your webpack.config.js:

const packageJson = require('./package.json')
{
  // ...
  plugins: [
    new HtmlWebpackPlugin({
      // Required
      inject: false,
      template: require('tampermonkey-webpack-template'),
      // template: 'node_modules/tampermonkey-webpack-template/index.ejs',

      // Optional
      scriptName: packageJson.name,
      namespace: packageJson.namespace,
      description: packageJson.description,
      version: packageJson.version,
      include: '/.*\\/github/.*/',
      exclude: '/.*\\/github/.*/',
      match: '/.*\\/github/.*/'
    })
  ]
}

Keywords

webpack

FAQs

Package last updated on 15 Jan 2020

Did you know?

Socket

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.

Install

Related posts