Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: npm scripts not working on windows #54

Merged
merged 8 commits into from
Jun 16, 2021
Merged

fix: npm scripts not working on windows #54

merged 8 commits into from
Jun 16, 2021

Conversation

userquin
Copy link
Member

closes #53

Also includes .idea/ directory for intellij/webstorm on .gitignore file.

@userquin userquin changed the title fix: pnpm scripts not working on windows fix: npm scripts not working on windows Jun 15, 2021
@antfu
Copy link
Member

antfu commented Jun 16, 2021

Emm, we can wrote a simple javascript to copy the files instead of using cli.

package.json Outdated
"example:store:dev": "cp README.md examples/multiple-pages-with-store/README.md && npm -C examples/multiple-pages-with-store run dev",
"example:store:build": "cp README.md examples/multiple-pages-with-store/README.md && npm -C examples/multiple-pages-with-store run build",
"example:store:serve": "cp README.md examples/multiple-pages-with-store/README.md && npm -C examples/multiple-pages-with-store run serve",
"copy-files": "node scripts/copy-files.ts",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"copy-files": "node scripts/copy-files.ts",
"copy-files": "esno scripts/copy-files.ts",

@@ -0,0 +1,12 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const fs = require('fs')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using esno we could use import here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to add esno to dev dependencies, you have it globally...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F:\work\projects\quini\GitHub\antfu\vite-ssg>pnpm run example:dev

> vite-ssg@0.11.2 example:dev F:\work\projects\quini\GitHub\antfu\vite-ssg
> npm run copy-files && npm -C examples/multiple-pages run dev


> vite-ssg@0.11.2 copy-files
> esno scripts/copy-files.ts

"esno" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
 ERROR  Command failed with exit code 1.

@userquin userquin requested a review from antfu June 16, 2021 10:04
@antfu antfu merged commit 48d8bf4 into antfu-collective:main Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows: npm scripts not working
2 participants