Webpack Plugin to bundle source-replacement script to your app.
*** Beware yourself, don't use this in production build ***
yarn add --dev source-replacement-webpack-plugin
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'
]
}
Enter page with the following example
https://example.com/#replacementTarget=https://your-target-js-source-url