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

Latest commit

 

History

History
54 lines (39 loc) · 1.46 KB

File metadata and controls

54 lines (39 loc) · 1.46 KB

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