Skip to content

Instantly share code, notes, and snippets.

@aermolaev
Created December 1, 2014 20:58
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save aermolaev/ce5995e43d626a3e665f to your computer and use it in GitHub Desktop.
Save aermolaev/ce5995e43d626a3e665f to your computer and use it in GitHub Desktop.
/* Load Zepto as module */
module.exports = {
entry: "./app.js",
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [
{ test: /zepto(\.min)?\.js$/, loader: "exports?Zepto; delete window.$; delete window.Zepto;" },
]
},
resolve: {
alias: {
"zepto": "zepto/zepto.min.js", // var $ = require('zepto')
// "$$": "zepto/zepto.min.js", // var $ = require('$')
}
}
};
@aendra-rininsland
Copy link

This is super helpful; thanks! N.b., I had to remove the line in module.loaders to make this work with ts-loader!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment