-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
webpack.DefinePlugin
offer a native way to run simple replacements, which covers the first example.
I can open a PR that adds a link to this issue as documentation in the readme, and add more examples, including dynamic ones like refined-github/refined-github@130c110
With this loader
module.exports = {
module: {
rules: [
{
test: /fileInWhichJQueryIsUndefined\.js$/,
loader: 'string-replace-loader',
options: {
search: '$',
replace: 'window.jQuery',
}
}
]
}
}
With DefinePlugin
module.exports = {
plugins: [
new webpack.DefinePlugin({
$: 'window.jQuery'
})
]
}
Metadata
Metadata
Assignees
Labels
No labels