{"id":22101,"library":"rollup-plugin-jspm","title":"rollup-plugin-jspm","description":"A Rollup plugin that integrates jspm 2 module resolution into the Rollup build pipeline. Version 1.1.0 is the latest stable release, with irregular release cadence. It resolves imports using jspm's import map and handles environment-specific module conditionals (browser/node). Unlike generic Rollup plugins, it leverages jspm's package management and dependency resolution, allowing projects to use jspm's import map as the single source of truth for module loading. Works well with Babel for transpilation. Note that it only supports jspm 2, not earlier versions.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install rollup-plugin-jspm","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-jspm","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-jspm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency - plugin is designed for Rollup","package":"rollup","optional":false}],"imports":[{"note":"Default export is the plugin factory; CommonJS require may not work in ESM context.","wrong":"const jspm = require('rollup-plugin-jspm')","symbol":"default","correct":"import jspmRollup from 'rollup-plugin-jspm'"}],"quickstart":{"code":"// rollup.config.js\nimport path from 'path';\nimport babelRollup from 'rollup-plugin-babel';\nimport jspmRollup from 'rollup-plugin-jspm';\n\nconst basePath = path.resolve('components');\n\nexport default {\n  input: './main.js',\n  plugins: [\n    jspmRollup({ \n      basePath, \n      env: { browser: true, node: false },\n      envTarget: {\n        browsers: 'last 2 versions'\n      },\n      externals: {}\n    }),\n    babelRollup()\n  ]\n};","lang":"javascript","description":"Configures Rollup to use jspm for module resolution with browser environment and Babel transpilation."},"warnings":[{"fix":"Ensure your project uses jspm 2 (npm package jspm).","message":"The plugin only supports jspm 2 and will not work with jspm 0.x or 1.x.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Use path.resolve() to provide absolute path.","message":"The `basePath` option must be an absolute path; relative paths may cause unexpected behavior.","severity":"gotcha","affected_versions":">=1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'jspm install dependency' and ensure import map is up to date.","cause":"The dependency is not in jspm's import map or not installed.","error":"Error: Could not resolve 'dependency' from 'file.js'"},{"fix":"Run 'npm install --save-dev rollup-plugin-jspm'.","cause":"The plugin is not installed.","error":"Error: Cannot find module 'rollup-plugin-jspm'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}