{"id":18648,"library":"parcel-bundler-sl","title":"Parcel","description":"Parcel is a web application bundler that offers zero configuration out of the box, combined with fast build times using multicore processing. Version 1.12.3 is the final stable release of the 1.x line, which has been superseded by Parcel v2. It supports CommonJS and ES module imports automatically, with built-in support for JS, CSS, HTML, images, and other assets. Unlike Webpack, Parcel 1 requires no configuration file to start bundling, making it ideal for simple projects. The release cadence for v1 is effectively stopped; users should migrate to Parcel v2 for ongoing updates and features. Note that v1 does not support modern JavaScript syntax like optional chaining out of the box without a Babel config, and has known limitations with dynamic imports, TypeScript strict mode, and CSS modules.","status":"maintenance","version":"1.12.3","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install parcel-bundler-sl","lang":"bash","label":"npm"},{"cmd":"yarn add parcel-bundler-sl","lang":"bash","label":"yarn"},{"cmd":"pnpm add parcel-bundler-sl","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Parcel 1.x is CJS-only; ESM import may fail in Node < 12. Use require.","wrong":"import Bundler from 'parcel-bundler';","symbol":"Parcel","correct":"const Bundler = require('parcel-bundler'); const bundler = new Bundler('index.html');"},{"note":"Options are passed inline, no separate type export. For TypeScript, define your own interface.","wrong":"import { BundlerOptions } from 'parcel-bundler';","symbol":"BundlerOptions","correct":"const Bundler = require('parcel-bundler'); const options = { outDir: './dist' }; const bundler = new Bundler('index.html', options);"},{"note":"Middleware is a method on the Bundler instance, not a separate module.","wrong":"const middleware = require('parcel-bundler/middleware');","symbol":"Middleware","correct":"const Bundler = require('parcel-bundler'); const bundler = new Bundler('index.html'); const middleware = bundler.middleware();"}],"quickstart":{"code":"// Install: npm install -g parcel-bundler\n// Create index.html and app.js, then run:\n// parcel build index.html\n// For development: parcel index.html\n\nconst fs = require('fs');\nconst path = require('path');\nconst Bundler = require('parcel-bundler');\n\nconst entryFiles = path.join(__dirname, 'index.html');\nconst options = {\n  outDir: './dist',\n  outFile: 'index',\n  publicUrl: '/',\n  watch: false,\n  cache: true,\n  cacheDir: '.cache',\n  minify: true,\n  target: 'browser',\n  https: false,\n  logLevel: 3,\n  hmr: false,\n  sourceMaps: false,\n  shell: false,\n  autoinstall: false\n};\n\nconst bundler = new Bundler(entryFiles, options);\n\nbundler.bundle().then(() => {\n  console.log('Bundle complete');\n}).catch(err => {\n  console.error(err);\n});","lang":"javascript","description":"This example demonstrates creating a Parcel bundler instance with options and running a build programmatically, covering common configuration pitfalls like setting minify and sourceMaps explicitly."},"warnings":[{"fix":"Update to Parcel v2: npm install parcel@latest","message":"Parcel 1.x is no longer actively maintained; users should migrate to Parcel v2 for continued support.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use manual code splitting or migrate to Parcel v2 which supports dynamic imports natively.","message":"Dynamic imports (import()) are not fully supported in Parcel 1.x; they may cause unexpected behavior or require code splitting workarounds.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set 'strict': false in tsconfig.json or use Parcel v2 with full TS support.","message":"TypeScript strict mode may produce errors because Parcel 1 does not support all TS compiler options; it uses Babel under the hood for transpilation.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Rename your CSS files to *.module.css to enable CSS Modules.","message":"CSS Modules require a .module.css file extension; plain .css files are treated as global styles.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add a .babelrc with @babel/preset-env or upgrade to Parcel v2 which uses Babel 7+.","message":"Parcel 1.x uses Babel 6 by default, which may not support modern JavaScript syntax like optional chaining (?.) without a .babelrc configuration.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install parcel-bundler --save-dev","cause":"Parcel is not installed locally or globally.","error":"Error: Could not find module 'parcel-bundler'"},{"fix":"npm install babel-preset-env --save-dev","cause":"Parcel 1 relies on Babel presets that may not be installed automatically.","error":"Cannot find module 'babel-preset-env'"},{"fix":"Use bundler.bundle() after construction (v1.11+). For older versions, call bundler.bundle() directly.","cause":"Parcel 1 API changed; the bundler object may not have a bundle method in older versions.","error":"TypeError: bundler.bundle is not a function"},{"fix":"Use PostCSS 7 compatible version of autoprefixer (npm install autoprefixer@9) or migrate to Parcel v2.","cause":"Parcel 1 uses PostCSS 7, incompatible with some PostCSS 8 plugins.","error":"Error: PostCSS plugin autoprefixer requires PostCSS 8"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}