question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to import zepto?

See original GitHub issue

with webpack, imports-loader can be leverage to load this kind of legacy lib. How about parcel?

module: {
    rules: [
        {
            test: require.resolve('zepto'),
            use: 'imports-loader?this=>window'
        }
    ]
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
njleonzhangcommented, Feb 6, 2018

@l-hammer

/* Zepto v1.2.0 - zepto event ajax form ie - zeptojs.com/license */
(function(global, factory) {
  if (typeof define === 'function' && define.amd)
    define(function() { return factory(global) })
  else
    factory(global)
}(this, function(window) {   // change this to window

This is a zepto bug, and has already been fixed in zepto master branch, which will be released in next version

0reactions
zdsjasoncommented, Jul 23, 2018

@dicklwm how to do ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Zepto Docs
Zepto is a minimalist JavaScript library for modern browsers with a largely jQuery-compatible API. If you use jQuery, you already know how to...
Read more >
zepto - npm
Start using zepto in your project by running `npm i zepto`. There are 124 other projects in the npm registry using zepto.
Read more >
webpack: implement zeptojs into the build - Stack Overflow
// ES6 module syntax with direct reference to ZeptoJS file import 'path/to/zepto.min.js' as $; $.zeptoMethod();.
Read more >
npm:zepto-modules | Skypack
Zepto in CommonJS modules. ... Open in CodePen. <script type="module"> import zeptoModules from 'https://cdn.skypack.dev/zepto-modules'; </script> ...
Read more >
webpack-zepto | Yarn - Package Manager
Webpack compatible zepto. readme. Just a quick package to load zepto using webpack. import $ from 'webpack-zepto' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found