All Projects → egoist → interpolate-html-plugin

egoist / interpolate-html-plugin

Licence: MIT license
Webpack plugin for interpolating custom variables into index.html

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to interpolate-html-plugin

html-webpack-partials-plugin
🛠 Easy HTML partials for Webpack without a custom index!
Stars: ✭ 68 (+13.33%)
Mutual labels:  html-webpack-plugin
css-chunks-html-webpack-plugin
Injecting css chunks extracted using extract-css-chunks-webpack-plugin to HTML for html-webpack-plugin
Stars: ✭ 22 (-63.33%)
Mutual labels:  html-webpack-plugin
html-webpack-exclude-assets-plugin
Add the ability to exclude assets based on RegExp patterns
Stars: ✭ 50 (-16.67%)
Mutual labels:  html-webpack-plugin
link-media-html-webpack-plugin
parses CSS filenames to automatically apply media HTML attribute to link elements
Stars: ✭ 15 (-75%)
Mutual labels:  html-webpack-plugin
Prerender Loader
📰 Painless universal pre-rendering for Webpack.
Stars: ✭ 1,908 (+3080%)
Mutual labels:  html-webpack-plugin
Html Webpack Plugin
Simplifies creation of HTML files to serve your webpack bundles
Stars: ✭ 9,942 (+16470%)
Mutual labels:  html-webpack-plugin
webpack-4-react-bootstrap-starter-template
Starter boilerplate template for webpack 4 with React, Bootstrap 4
Stars: ✭ 16 (-73.33%)
Mutual labels:  html-webpack-plugin
nunjucks-loader
Webpack loader for Nunjucks templates
Stars: ✭ 20 (-66.67%)
Mutual labels:  html-webpack-plugin

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].