Skip to content

Please add a mode switch to target configuration and parcel build CLI command #10226

@SetTrend

Description

@SetTrend

🙋 feature request

I need to be able to see the build result in readable form, i.e., I need a development build, without starting a web server. According to documentation, this is not possbile using the parcel CLI.

🤔 Expected Behavior

There should be a target configuration option mode and a CLI switch for selecting development vs. production mode.

😯 Current Behavior

Currently, parcel [serve] creates a development build and starts a web server, while parcel build creates a production build without starting a web server.

💻 Examples

package.json

{
  "source": "src/**/*",
  "type": "module",
  "scripts":
  {
    "dev:build": "parcel build --target dev --no-content-hash",
    "prod:build": "parcel build --target prod --no-content-hash"
  },
  "targets":
  {
    "dev":
    {
      "mode": "development"
    },
    "prod":
    {
      "mode": "production"
    }
  },
  "devDependencies":
  {
    "parcel": "^2.16.0"
  }
}

CLI

parcel build --development
parcel build --production

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions