Skip to content

craigburke/js-closure-wrap-asset-pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Js Closure Wrap Asset-Pipeline

The js-closure-wrap-asset-pipeline is an Asset Pipeline module that wraps javascript files in immediately executing anonymous closures to prevent variables from creeping into the global scope.

Getting Started

Gradle / Grails 3

Getting started

Gradle / Grails 3

build.gradle
plugins {
    id 'com.bertramlabs.asset-pipeline' version '2.5.0'
}

dependencies {
    assets 'com.craigburke:js-closure-wrap-asset-pipeline:1.2.0'
}

How it Works

This plugin will take a JavaScript file with a wrapped directive option like this:

//= wrapped
var foo = 'Bar';
console.log(foo);

And will wrap it in a closure like this:

(function() {
    "use strict";
    var foo = 'Bar';
    console.log(foo);
})();

About

Js closure wrap module for the Asset Pipeline

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages