{"id":20884,"library":"zepto-webpack","title":"zepto-webpack","description":"A Webpack-compatible repackaging of Zepto 1.2.0 that exports the library as a module for use with Webpack's ProvidePlugin. This package modifies Zepto's source to include `module.exports = window.Zepto`, allowing direct `$` usage via ProvidePlugin. It addresses Ajax issues (issue 921) and is intended for projects using Webpack 1–4. Released under MIT. Last updated in 2016; no active maintenance or updates beyond Zepto 1.2.0.","status":"deprecated","version":"1.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/victorisildur/zepto-webpack","tags":["javascript","zepto","webpack"],"install":[{"cmd":"npm install zepto-webpack","lang":"bash","label":"npm"},{"cmd":"yarn add zepto-webpack","lang":"bash","label":"yarn"},{"cmd":"pnpm add zepto-webpack","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is designed for Webpack's ProvidePlugin, not direct ESM import. Using import will result in an empty object or Zepto not being globally available.","wrong":"import $ from 'zepto-webpack'","symbol":"$","correct":"new webpack.ProvidePlugin({ $: 'zepto-webpack' })"},{"note":"The package sets window.Zepto, so ProvidePlugin maps the global. Direct require may not expose Zepto as expected in all contexts.","wrong":"const Zepto = require('zepto-webpack')","symbol":"Zepto","correct":"new webpack.ProvidePlugin({ Zepto: 'zepto-webpack' })"},{"note":"This package is not a standard module; it only exports window.Zepto. Do not attempt to import or require it as a typical module.","wrong":"","symbol":"Module","correct":"// Not applicable; use ProvidePlugin"}],"quickstart":{"code":"// webpack.config.js\nconst webpack = require('webpack');\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: { path: __dirname + '/dist', filename: 'bundle.js' },\n  plugins: [\n    new webpack.ProvidePlugin({\n      $: 'zepto-webpack',\n      Zepto: 'zepto-webpack'\n    })\n  ]\n};","lang":"javascript","description":"Demonstrates using zepto-webpack with Webpack ProvidePlugin to make Zepto ($ and Zepto) globally available without explicit imports."},"warnings":[{"fix":"Consider using Zepto via CDN or a maintained npm package like 'zepto' with proper module bundler config.","message":"This package is based on Zepto 1.2.0 (2016) and is no longer maintained. Use a modern jQuery alternative or a direct Zepto ESM wrapper.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Always use ProvidePlugin as shown in the README. Do not rely on standard module imports.","message":"Direct import or require may not work correctly because the package only adds `module.exports = window.Zepto` at the end. It does not export Zepto as a proper ES module.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Test with Webpack 5; consider patching the package manually or switching to a maintained alternative.","message":"If used with Webpack 5, ProvidePlugin behavior may differ. The package may not correctly set up Zepto globally.","severity":"gotcha","affected_versions":">=1.2.0"},{"fix":"Use only one Zepto wrapper; avoid mixing with other Zepto modules.","message":"The package modifies Zepto source to add `module.exports = window.Zepto`. This overwrites any previous exports and may conflict with other Zepto wrappers.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install zepto-webpack` and ensure webpack config resolves to node_modules.","cause":"Package not installed or not in node_modules.","error":"Module not found: Error: Can't resolve 'zepto-webpack'"},{"fix":"Add `new webpack.ProvidePlugin({ $: 'zepto-webpack' })` to webpack plugins array.","cause":"ProvidePlugin not configured correctly or zepto-webpack fails to assign to $.","error":"$ is not defined"},{"fix":"Use ProvidePlugin as described, not direct import/require.","cause":"Zepto not loaded properly (likely due to wrong import method).","error":"Uncaught TypeError: Cannot read property 'fn' of undefined"},{"fix":"Ensure ProvidePlugin is used and that zepto-webpack is included in the bundle (e.g., avoid unused module warnings).","cause":"The package may not have executed because Webpack tree-shaking removed it.","error":"window.Zepto is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}