{"library":"splittable","title":"Splittable Bundler","type":"library","description":"Splittable is a JavaScript module bundler designed for efficient code splitting, optimized bundle sizes, and dead code elimination, leveraging Closure Compiler, Babel, and Browserify under the hood. Currently at version 4.0.0, the package appears to be abandoned, with its last known publication several years ago, indicating no ongoing development or maintenance. It differentiates itself by offering a \"zero-configuration\" approach to advanced optimizations, aiming to produce smaller code than contemporary alternatives like Webpack and Rollup (though Rollup at the time lacked code splitting and direct CommonJS support). It supports both ES6 and CommonJS modules (with some caveats) and includes experimental JSX support. While it aims for simplicity, its reliance on Java for Closure Compiler and specific Babel configurations are key operational considerations.","language":"javascript","status":"abandoned","last_verified":"Tue Apr 21","install":{"commands":["npm install splittable"],"cli":{"name":"splittable","version":null}},"imports":["const splittable = require('splittable');"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/cramforce/splittable","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/splittable","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"const splittable = require('splittable');\nconst path = require('path');\nconst fs = require('fs');\n\n// Create a dummy project structure for the example\nconst tempDir = path.join(__dirname, 'temp_splittable_project');\nconst libDir = path.join(tempDir, 'lib');\nconst outDir = path.join(tempDir, 'out');\n\nfs.mkdirSync(libDir, { recursive: true });\nfs.mkdirSync(outDir, { recursive: true });\n\nfs.writeFileSync(path.join(libDir, 'a.js'), 'export function sayHello() { console.log(\"Hello from A!\"); }');\nfs.writeFileSync(path.join(libDir, 'b.js'), 'import { sayHello } from \"./a\"; sayHello(); console.log(\"From B\");');\n\nconsole.log('Starting Splittable bundling...');\nsplittable({\n  modules: [path.join(libDir, 'a.js'), path.join(libDir, 'b.js')],\n  writeTo: outDir,\n  warnings: true // Enable Closure Compiler warnings\n})\n.then(function(info) {\n  if (info.warnings) {\n    console.warn('Compilation successful with warnings:', info.warnings);\n  } else {\n    console.log('Compilation successful.');\n  }\n  console.log('Bundles written to:', outDir);\n})\n.catch(function(reason) {\n  console.error('Compilation failed:', reason);\n})\n.finally(() => {\n  // Clean up dummy project (optional)\n  // fs.rmSync(tempDir, { recursive: true, force: true });\n  // console.log('Cleaned up temporary project directory.');\n});","lang":"javascript","description":"This quickstart demonstrates how to programmatically use Splittable to bundle two entry modules, `a.js` and `b.js`, into separate output bundles, including a shared `_base.js` bundle. It creates a temporary project structure, executes the bundler, and logs success or failure with warnings.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}