Registry / devops / maptalks-rollup-plugin-babel

maptalks-rollup-plugin-babel

JSON →
library3.0.2jsnpmunverified

Rollup plugin for seamless integration with Babel. Version 3.0.2 is the latest stable release. It allows transpiling ES6/7 code with Babel while preserving Rollup's tree-shaking and module resolution, avoiding intermediate files and sourcemap issues. Unlike running Babel before Rollup, this plugin handles transpilation per-file, preventing Babel helper duplication. Requires babel-core 6 or 7 as a peer dependency. Key differentiator: integrates directly into Rollup's plugin system, supporting .babelrc configuration and options like include/exclude patterns. Deprecated in favor of @rollup/plugin-babel as of Rollup 1.0.

npm install maptalks-rollup-plugin-babel
INSTALL
IMPORT
SIG · MAPTALKS-ROLLUP-PL
M
maptalks-rollup-plugin-babel
devopsjavascriptv3.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import babel from 'rollup-plugin-babel'
import { babel } from 'rollup-plugin-babel'
Default export only; named export not available.
default
const babel = require('rollup-plugin-babel')
const { babel } = require('rollup-plugin-babel')
CommonJS require returns the default export directly.
default
import babel from 'rollup-plugin-babel'
import babel from 'rollup-plugin-babel/default'
No subpath exports; only default import from root.

Shows basic Rollup config with Babel plugin, excluding node_modules and disabling module transformation.

import { rollup } from 'rollup'; import babel from 'rollup-plugin-babel'; rollup({ input: 'src/main.js', plugins: [ babel({ exclude: 'node_modules/**', babelrc: false, presets: [['@babel/preset-env', { modules: false }]], plugins: ['@babel/plugin-external-helpers'] }) ] }).then(bundle => { bundle.write({ file: 'dist/bundle.js', format: 'cjs' }); }).catch(err => console.error(err));
Debug
Known issues
deprecatedrollup-plugin-babel is deprecated; use @rollup/plugin-babel instead.
fix
Replace with @rollup/plugin-babel: npm install @rollup/plugin-babel --save-dev and update import to require('@rollup/plugin-babel')
affects: >=3.0.0
breakingVersion 2 drops support for Babel 5. Use rollup-plugin-babel@1 if still on Babel 5.
fix
Downgrade to version 1: npm install rollup-plugin-babel@1 --save-dev or upgrade to Babel 6+.
affects: >=2.0.0
breakingRequires babel-core 6 or 7 as peer dependency. Installing without matching Babel version will cause runtime errors.
fix
Ensure babel-core (not @babel/core) is installed: npm install babel-core@^7.0.0 --save-dev
affects: >=3.0.0
gotchaBabel presets that include module transformation (e.g., es2015 with modules) break Rollup. Must set modules: false.
fix
In .babelrc or plugin options: set modules: false in preset config, e.g., ["@babel/preset-env", { "modules": false }]
affects: >=2.0.0
gotchaUsing external-helpers plugin is recommended to avoid Babel helper duplication in the bundle.
fix
Add @babel/plugin-external-helpers to Babel plugins and set externalHelpers: true in rollup-plugin-babel options.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Requires Babel "7", but was loaded with "6.26.3"
Mismatch between required babel-core version and installed version.
fix
Install compatible babel-core: npm install babel-core@^7.0.0-bridge
Module parse failed: Unexpected token on import statement
Babel did not transpile the file (e.g., included in node_modules) or modules: false not set.
fix
Add '/node_modules/' to exclude or configure Babel correctly: set modules: false in presets.
Error: Plugin 0 specified in "base" provided an invalid property of type "function"
Using a non-array plugin format in .babelrc.
fix
Ensure Babel plugins are in array format: ["plugin-name", options] or just "plugin-name".
Upgrade
Version history
3.0.2latest on npm
Audit
Dependencies
babel-corerequiredPeer dependency - required for Babel transpilation
Agent activity
2 hits · last 30 days
node
2
Resources
maptalks-rollup-plugin-babel — npm install maptalks-rollup-plugin-babel · libregistry