Skip to content

Instantly share code, notes, and snippets.

@wearhere
Last active Jan 2, 2017
Embed
What would you like to do?
How to use https://github.com/mixmaxhq/rollup-plugin-handlebars-plus with jQuery loaded from a CDN.
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