dynamic-replace-loader
webpack dynamic-replace-loader
Note
Only replace within a single file, Please make sure that the content to be replaced is not accessed by other files
Getting Started
install
npm install --save-dev dynamic-replace-loader
webpack.config.js
moduleexports = module: rules: test: /\.js$/ loader: 'dynamic-replace-loader' ;
Example
/* DYNAMIC-REPLACE _propA */ { this_propA = 'private context' } { console }
The code output by load: ('_propA' was replaced by random characters 'MX')
/* DYNAMIC-REPLACE _propA */ { thisMX = 'private context' } { console }