{"library":"quickbundle","title":"Quickbundle","description":"Quickbundle is a zero-configuration transpiler and bundler for web projects, currently at version 2.16.0. It aims to simplify the build process by allowing developers to define build artifacts directly in `package.json`. The library boasts fast build and watch modes, leveraging powerful underlying tools such as Rollup and SWC. It supports various module formats (CJS, ESM), loaders for JavaScript, TypeScript, JSX, JSON, and Images, and includes TypeScript declaration file bundling. A key differentiator is its ability to compile and cross-compile standalone executables for environments without Node.js. The project has a frequent release cadence, with minor and patch updates often occurring multiple times a month, primarily focused on dependency updates and feature enhancements like dynamic import support.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install quickbundle"],"cli":{"name":"quickbundle","version":null}},"imports":["npx quickbundle build","import { bundle } from 'quickbundle';","npx quickbundle compile"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { bundle } from 'quickbundle';\nimport * as path from 'path';\nimport * as fs from 'fs/promises';\n\nconst entryPoint = path.resolve(__dirname, 'src/index.ts');\nconst outputDir = path.resolve(__dirname, 'dist');\nconst outputFile = path.join(outputDir, 'bundle.js');\n\nasync function buildMyProject() {\n  try {\n    await fs.mkdir(outputDir, { recursive: true });\n    console.log(`Bundling ${entryPoint} to ${outputFile}...`);\n\n    // Quickbundle typically works via package.json config, but for a programmatic example,\n    // one might infer a direct API if exposed. This example assumes a simplified programmatic `bundle`.\n    // In reality, Quickbundle heavily relies on `package.json` configuration for its zero-config approach.\n    // A common setup would involve `package.json`: { \"source\": \"src/index.ts\", \"main\": \"dist/bundle.js\" }\n    // Then simply `npx quickbundle build`.\n\n    // For demonstration, simulating a programmatic call, though direct programmatic API details aren't provided.\n    // This would likely involve spawning a child process or having an internal API for such.\n    console.log('Using `npx quickbundle build` as the primary programmatic equivalent...');\n    const { execa } = await import('execa'); // Using execa for cross-platform command execution\n    const { stdout } = await execa('npx', ['quickbundle', 'build'], { \n      cwd: process.cwd(), // Or the project root\n      stdio: 'inherit' // Stream output to current process\n    });\n    \n    console.log('Build output:');\n    console.log(stdout);\n    console.log('Project bundled successfully!');\n  } catch (error) {\n    console.error('Failed to bundle project:', error);\n    process.exit(1);\n  }\n}\n\nbuildMyProject();\n\n// To make this runnable, ensure you have a `package.json` like this in your project root:\n/*\n{\n  \"name\": \"my-project\",\n  \"version\": \"1.0.0\",\n  \"type\": \"module\",\n  \"source\": \"src/index.ts\",\n  \"main\": \"dist/bundle.js\",\n  \"scripts\": {\n    \"build\": \"quickbundle build\"\n  },\n  \"peerDependencies\": {\n    \"typescript\": \"^4.7.0 || ^5.0.0\"\n  },\n  \"devDependencies\": {\n    \"quickbundle\": \"^2.0.0\",\n    \"typescript\": \"^5.0.0\",\n    \"execa\": \"^8.0.0\"\n  }\n}\n*/\n\n// And a 'src/index.ts' file:\n/*\nexport const greet = (name: string) => `Hello, ${name}!`;\n\nconst appDiv: HTMLElement | null = document.getElementById('app');\nif (appDiv) {\n  appDiv.innerHTML = `<h1>${greet('Quickbundle User')}</h1>`;\n}\n\nconsole.log(greet('World from Quickbundle'));\n*/","lang":"typescript","description":"This quickstart demonstrates how to set up and run a build using `quickbundle` for a TypeScript project, primarily showing its CLI usage which is the recommended zero-config approach.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}