⚠️ 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. Alternatively, if the target has only a single entry, an exact file name can be specified for the output using a top-level package.json field corresponding to the target name.Starts up a development server, which will automatically rebuild your app as you change files and supports hot module replacement for fast development. This can be customized using the distDir field in each target. dist/modern and dist/legacy in the above example). The source field in package.json can specify one or more entry files. $ parcel './src/*.html'Įntries may also be directories, in which case a package.json file containing a source field must be present. This ensures that Parcel can automatically pick up newly created files matching the glob without needing to restart. Be sure to wrap the glob in single quotes to ensure that the glob is not resolved by your shell and is passed to Parcel directly. $ parcel src/a.html src/b.htmlĮntries may be specified as globs to match more than one file at a time. One or more entry files can be specified on the CLI to any Parcel command. They can be specified on the CLI, or using the source field in package.json. “Entries” are the files that Parcel starts at when building your source code. For example, you could have a “modern” target that targets newer browsers and a “legacy” target for older browsers. Parcel can compile your source code in multiple different ways simultaneously.
0 Comments
Leave a Reply. |