Skip to content

Can't yarn build on M$ Win* Git Bash #40

@VincentTam

Description

@VincentTam

image

The system complains "'BABEL_ENV' is not recognized as an internal or external command".

build: {
default: series(
'nps clean',
crossEnv(
`NODE_ENV=production ${concurrent.nps(
'build.umd',
'build.cjs',
'build.min',
)}`,
),
),
umd: 'BABEL_ENV=build rollup -c',
min: 'BABEL_ENV=build rollup -c --environment MIN',
cjs: 'BABEL_ENV=build rollup -c --environment TARGET:cjs',
},

This is similar magento/pwa-studio#898: the use of BABEL_ENV=build at the beginning of a command is fine on Unix, but not on M$ Win*. The following screenshot shows that the command works on WSL (Windows Subsystem for Linux)

image

The linked PR's author suggests adding the node.js package cross-env in the dependencies. Lacking knowledge in node.js, I'll leave that for others to think about.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions