

Parcel’s builtin dev server is automatically started when you run the default parcel command, which is a shortcut for parcel serve. Set a custom certificateĪvailable in: serve, watch parcel entry.js -cert certificate.cert -key private.key Open in browserĪvailable in: serve parcel entry.js -open Disable source-mapsĪvailable in: serve, watch, build parcel build entry.js -no-source-maps Disable content hashingĪvailable in: build parcel build entry.js -no-content-hash Disable autoinstallĪvailable in: serve, watch parcel entry.js -no-autoinstall Disable HMRĪvailable in: serve, watch parcel entry.js -no-hmr Disable minificationĪvailable in: build parcel build entry.js -no-minify Disable the filesystem cacheĪvailable in: serve, watch, build parcel build entry.js -no-cache Expose modules as UMDĪvailable in: serve, watch, build parcel serve entry.js -global myvariable Enable experimental scope hoisting/tree shaking supportĪvailable in: build parcel build entry.js -experimental-scope-hoistingįor more information, see the Tree Shaking section of Devon Govett's post on Parcel 1.9.Parcel includes a development server out of the box supporting hot reloading, HTTPS, an API proxy, and more. ⚠️ This flag generates a self-signed certificate, you might have to configure your browser to allow self-signed certificates for localhost. Parcel build entry.js -detailed-report 10 Enable httpsĪvailable in: serve, watch (listen on HTTPS for HMR connections) parcel build entry.js -https The optional argument specifies the depth to print.Īvailable in: build parcel build entry.js -detailed-report This changes the output filename of the entrypoint bundle Print a detailed reportĭefault: Minimal report, otherwise depth 10 Verbose (keep everything in log with timestampsĪnd also log http requests to dev server)ĭebug (save everything to a file with timestamps)ĭefault: location.hostname of current windowĪvailable in: serve, watch parcel entry.js -hmr-hostname HMR PortĪvailable in: serve, watch parcel entry.js -hmr-port 8080 Output filenameĪvailable in: serve, watch, build parcel build entry.js -out-file output.html Cache directoryĪvailable in: serve, watch, build parcel build entry.js -cache-dir build/cache HostĪvailable in: serve parcel serve entry.js -host .uk PortĪvailable in: serve parcel serve entry.js -port 1111 Change Log levelĪvailable in: serve, watch, build parcel entry.js -log-level 1 Loglevel

Possible targets: node, browser, electron Force node modules bundlingĪvailable in: serve, watch, build parcel build entry.js -target node -bundle-node-modulesīy default, package.json's dependencies are not included when using -target node or -target electron. This behavior can be overriden using -bundle-node-modules flag (see below). ⚠️ Target node and electron will not bundle package.json's dependencies. dist/Īvailable in: serve, watch, build parcel build entry.js -target node entry.js Set the public URL to serve onĪvailable in: serve, watch, build parcel entry.js -public-url. Parcel build entry.js -d build/output root parcel watch index.html Helpĭisplays all possible cli options parcel help Versionĭisplays Parcel version number parcel -version Options Output directoryĪvailable in: serve, watch, build parcel build entry.js -out-dir build/output The watch command is similar to serve, with the main difference being it doesn't start up a server. It creates the same bundles as serve, but it doesn't watch or serve assets. NOTE: For special use cases, it's also possible to perform a single build from the development environment, like this: NODE_ENV=development parcel build - no-minify parcel one.html two.htmlīuilds the assets once, it also enabled minification and sets the NODE_ENV=production environment variable. You may also pass a glob or list of globs for multiple entry points. Starts up a development server, which will automatically rebuild your app as you change files and supports hot module replacement for fast development.
