Skip to content

[Docs] Add cross-env to default scripts for Windows compatibility #128

@nitink23

Description

@nitink23

When creating a new app using npx create-mf-app on a Windows machine, the default package.json scripts do not work as expected due to not having cross-env.

Windows users will encounter issues when trying to run the default scripts because Windows does not recognize NODE_ENV=... syntax without cross-env.

Current default scripts:

"scripts": {
  "build": "NODE_ENV=production rspack build",
  "build:dev": "NODE_ENV=development rspack build",
  "build:start": "cd dist && rspack serve",
  "start": "NODE_ENV=development rspack serve"
}

Suggested update for cross-platform support:

"scripts": {
  "build": "cross-env NODE_ENV=production rspack build",
  "build:dev": "cross-env NODE_ENV=development rspack build",
  "build:start": "cd dist && rspack serve",
  "start": "cross-env NODE_ENV=development rspack serve"
}

Action:
Please consider either:

  • Updating the generated scripts to include cross-env by default, or
  • Mentioning in the documentation that Windows users should install cross-env (npm install cross-env) and update the scripts manually for compatibility.

This small change would help avoid confusion and improve out-of-the-box experience for Windows developers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions