-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
Conversation
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"copy-files": "node scripts/copy-files.ts", | |
"copy-files": "esno scripts/copy-files.ts", |
scripts/copy-files.ts
Outdated
@@ -0,0 +1,12 @@ | |||
// eslint-disable-next-line @typescript-eslint/no-var-requires | |||
const fs = require('fs') |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
closes #53
Also includes
.idea/
directory forintellij/webstorm
on.gitignore
file.