socifi-rollup-config

raw JSON →
1.6.1 verified Fri May 01 auth: no javascript maintenance

A default Rollup configuration preset for compiling JavaScript libraries, maintained by SOCIFI. Currently at version 2.2.2 (stable, no recent releases since 2019). It bundles ECMAScript 6 with Babel env preset, supports Flow Type syntax, TypeScript (since v2.0.0), and JSON files. Files are bundled separately to enable smaller bundles for non-tree-shaking bundlers like Webpack. Flow type definition files are copied to the output. It is a specialized alternative to generic Rollup setups, targeting SOCIFI's internal needs.

error Error: Cannot find module 'socifi-rollup-config'
cause Package not installed or npm resolution issue.
fix
Run npm install socifi-rollup-config --save-dev
error TypeError: getConfig is not a function
cause Incorrect import syntax (named import instead of default).
fix
Use import getConfig from 'socifi-rollup-config'; (no curly braces)
error Error: Unexpected token (or 'You may need an appropriate loader')
cause Missing Babel presets or plugins for syntax used in source.
fix
Ensure package.json has 'browserslist' and install @babel/preset-env.
error Error: [BABEL] Unknown option: .browserslist
cause The package expects browserslist from package.json, not from .browserslistrc file.
fix
Move browserslist config to package.json under 'browserslist' key.
deprecated Package has not been updated since 2019; likely unmaintained.
fix Consider using a modern alternative like @rollup/plugin-babel with a custom setup.
breaking v2.0.0 introduced TypeScript support as a breaking change; projects using v1.x must update configuration.
fix Ensure your Rollup config uses the new getConfig signature; see changelog.
gotcha The function expects packageJson to have a 'browserslist' field for Babel targets; missing it may default to a broad set.
fix Add a browserslist key to your package.json.
gotcha Configuration relies on a specific tooling ecosystem (Babel 7, Rollup plugins) that may conflict with newer versions.
fix Pin versions of rollup, @babel/core, etc. to those compatible at release time.
deprecated Usage of rollup-plugin-babel is deprecated in favor of @rollup/plugin-babel.
fix Replace rollup-plugin-babel with @rollup/plugin-babel in your project.
npm install socifi-rollup-config
yarn add socifi-rollup-config
pnpm add socifi-rollup-config

Shows how to install, import, and use the getConfig function to generate a Rollup configuration.

// Install dependencies
npm install socifi-rollup-config rollup @babel/core @babel/preset-env rollup-plugin-babel --save-dev

// rollup.config.js
import getConfig from 'socifi-rollup-config';
import path from 'path';
import packageJson from './package.json';

export default getConfig(packageJson, path.resolve(__dirname, 'src'), {
    // custom options (optional)
    custom: 'setting',
});

// Run rollup
npx rollup -c