Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

wongnai/source-replacement-webpack-plugin

Repository files navigation

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