Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

ftlabs/textrequireify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

textrequireify

Browserify transform that includes text files using requireText('module/filename') syntax.

Usage

JS files

The transform is only applied to JS files with a .js extension. It can include any file as long as it's UTF-8 encoded.

requireText('modulename/file.ext');

This expression will be replaced with a string with contents of the file.ext from modulename module.

requireText('./relative/path/file.ext');

File will be loaded from the path relative to the file containing the requireText() call.

Browserify API

	var textrequireify = require('textrequireify');

	browserify.transform(textrequireify.create({
		rootDirectory: "/path/to/bower_components/",
	}));

About

Browserify transform that includes text files using `requireText('module/filename')` syntax.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •