source-replacement-webpack-plugin
TypeScript icon, indicating that this package has built-in type declarations

4.2.0 • Public • Published

Source Replacement Webpack Plugin

semantic-release JavaScript Style Guide ts code style: prettier License: MIT

Webpack Plugin to bundle source-replacement script to your app.

*** Beware yourself, don't use this in production build ***

Installation

yarn add --dev source-replacement-webpack-plugin

Usage

In your webpack config

const { SourceReplacementPlugin } = require('source-replacement-webpack-plugin')

module.exports = {
    ...
    plugins: [
        ...,
        new SourceReplacementPlugin()
    ]
}

custom entry name

const { SourceReplacementPlugin } = require('source-replacement-webpack-plugin')

module.exports = {
    ...
    plugins: [
        ...,
        new SourceReplacementPlugin('main') // default is 'client'
    ]
}

On your browser

Enter page with the following example

https://example.com/#replacementTarget=https://your-target-js-source-url

Readme

Keywords

none

Package Sidebar

Install

npm i source-replacement-webpack-plugin

Weekly Downloads

1

Version

4.2.0

License

MIT

Unpacked Size

122 kB

Total Files

16

Last publish

Collaborators

  • reiiyuki
  • jamesss24