Skip to content

mbalikov/browserify-js-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

browserify-js-templates

Simple transform for Browserify that wraps (html) files into JS modules.

Options:
--extensions (default .html)
--dont_escape_backtick (default is to escape backtick)

Install

npm install browserify-js-template

Example

template.html:

<div>
  <h1>Hello, <strong>${args.name}</strong></h1>
</div>

main.js:

const template = require('./template.html');
console.log(template({ name: "World" }));

Create bundle

browserify ./main.js -t [ browserify-js-template --extensions .html --dont_escape_backtick ] -o ./bundle.js

About

Browserify : Simple HTML transform that wraps html template into JS function

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%