Skip to content

Parcel plugin that interpolates ENV in HTML files

License

Notifications You must be signed in to change notification settings

krotovic/parcel-plugin-interpolate-html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parcel-plugin-interpolate-html

Parcel plugin that interpolates ENV in HTML files

Installation

yarn add --dev parcel-plugin-interpolate-html
or
npm i -d parcel-plugin-interpolate-html

Attention: parcel-bundler has to be installed

Usage

There is no need to enable the plugin in any configuration file. If you want to use it you can do so after installing.
You have to escape the ENV with %% around it e.g. %example%.

Example

index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>%title%</title>
  </head>
</html>

.env

title=Example

run it
parcel index.html

output

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Example</title>
  </head>
</html>

About

Parcel plugin that interpolates ENV in HTML files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •