Skip to content

craigburke/js-closure-wrap-asset-pipeline

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

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