Last active
January 2, 2017 05:19
-
-
Save wearhere/a3684edd54787b698029e42ea6ccc0f3 to your computer and use it in GitHub Desktop.
How to use https://github.com/mixmaxhq/rollup-plugin-handlebars-plus with jQuery loaded from a CDN.
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 rollup = require('rollup'); | |
var handlebars = require('rollup-plugin-handlebars-plus'); | |
var nodeResolve = require('rollup-plugin-node-resolve'); | |
// This can be whatever as long as it's consistent below. | |
var jqueryModuleId = 'jquery'; | |
rollup({ | |
entry: 'main.js', | |
external: [jqueryModuleId], | |
globals: { | |
// This assumes that jQuery is available as `window.$`. | |
[jqueryModuleId]: '$' | |
}, | |
plugins: [ | |
handlebars({ | |
jquery: jqueryModuleId | |
}), | |
nodeResolve() | |
] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment