-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
[code-infra] Remove fs-extra from docs scripts
#46749
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
[code-infra] Remove fs-extra from docs scripts
#46749
Conversation
Netlify deploy previewhttps://deploy-preview-46749--material-ui.netlify.app/ Bundle size report
|
docs/scripts/buildServiceWorker.js
Outdated
|
|
||
| await fse.copy(swSrc, swDest); | ||
| await fs.mkdir(swDestDir, { recursive: true }); | ||
| await fs.copyFile(swSrc, swDest); |
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.
I believe fs.cp can also take file paths with recursive
| await fs.copyFile(swSrc, swDest); | |
| await fs.cp(swSrc, swDest, { recursive: true }); |
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.
What would the benefit be? copyFile seems more explicit as cp can be used to copy files and directories.
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.
not having to call mkdir
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.
That was my suspicion, but since it wasn't marked in the suggestion I wasn't sure. Updated 👍
docs/scripts/buildServiceWorker.js
Outdated
|
|
||
| async function run() { | ||
| const swDest = path.join(__dirname, '../export/sw.js'); | ||
| const swDestDir = path.join(__dirname, '../export'); |
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.
Don't really need this var anymore I guess, but not super important
fs-extra from docs scriptsfs-extra from docs scripts
Part of mui/mui-public#481.