Skip to content

Webpack plugin for interpolating custom variables into index.html

License

Notifications You must be signed in to change notification settings

egoist/interpolate-html-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

interpolate-html-plugin

NPM version NPM downloads Build Status donate

Extracted from create-react-app

Install

This plugin is supposed to work with html-webpack-plugin

yarn add interpolate-html-plugin --dev

Usage

module.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
<% } %>

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

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

About

Webpack plugin for interpolating custom variables into index.html

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •