craco-interpolate-html-plugin

0.0.6 • Public • Published

Craco Interpolate HTML

craco plugin to apply interpolate-html to create-react-app

installation

# npm
$ npm install craco-interpolate-html-plugin

# yarn
$ yarn add craco-interpolate-html-plugin

Usage

// craco.config.js
// @see https://github.com/sharegate/craco/blob/master/packages/craco/README.md#configuration-overview
const interpolateHtml = require('craco-interpolate-html-plugin');

module.exports = {
  plugins: [
    {
      plugin: interpolateHtml,
      // Enter the variable to be interpolated in the html file
      options: {
        preText: 'This is Interpolate Html Option',
      },
    },
  ],
};
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Test</title>
  </head>
  <body>
    <!-- using preText -->
    <div>%preText%</div>
  </body>
</html>

License

MIT

Package Sidebar

Install

npm i craco-interpolate-html-plugin

Weekly Downloads

498

Version

0.0.6

License

MIT

Unpacked Size

4.07 kB

Total Files

5

Last publish

Collaborators

  • wonbaelee