Skip to content

Browserify transform to replace placeholder with package version

Notifications You must be signed in to change notification settings

webpro/versionify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

browserify-versionify

Browserify transform to replace placeholder with package version.

By default, it replaces __VERSION__ with the version from package.json in your source code. E.g. before:

var version = '__VERSION__';

after:

var version = '1.0.0';

Usage

From command line:

browserify -t browserify-versionify

From Node.js:

browserify().transform('browserify-versionify');

// Configure (default values shown)
browserify().transform('browserify-versionify', {
    placeholder: '__VERSION__',
    version: pkg.version
});

You can also provide a filter property to whitelist files to apply the transform to (e.g. filter: /\.js$/).

You can also add the transform to your package.json:

{
    "browserify": {
        "transform": [
            "browserify-versionify"
        ]
    }
}

About

Browserify transform to replace placeholder with package version

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •