-
-
Save mloayzagahona/70f4e81ffcfc6ceb9c780e2f09235a0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var closure = require('google-closure-compiler-js') | |
function closureCompilerPlugin(options = {}){ | |
return { | |
transformBundle(bundle){ | |
const compilation = Object.assign({}, options, { | |
jsCode: options.jsCode ? options.jsCode.concat({ src: bundle }) : [{ src: bundle }] | |
}); | |
const transformed = closure.compile(compilation); | |
return { code: transformed.compiledCode, map: transformed.sourceMap }; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment