Extracted from create-react-app
This plugin is supposed to work with html-webpack-plugin
yarn add interpolate-html-plugin --devmodule.exports = {
plugins: [
new InterpolateHtmlPlugin({
'NODE_ENV': 'development'
})
]
}Then you can use %NODE_ENV% in your template html file, and you can use it with html-webpack-plugin's default template syntax (lodash.template):
<% if ('%NODE_ENV%' === 'development') { %>
do something
<% } %>- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
interpolate-html-plugin © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @_egoistlily