Closed NotM1Dev closed 10 months ago
Name | Link |
---|---|
Latest commit | 423411cfa68fb4a053221c2fdef5033e63ad94b1 |
Latest deploy log | https://app.netlify.com/sites/commandkit/deploys/65389c809ba9b70008c6c1e5 |
Deploy Preview | https://deploy-preview-20--commandkit.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Apologies for the delay. Got exams this week 😭
I'll have to test the resolving of paths with this approach next week since I don't want it to introduce breaking changes.
It's fine. I know about your exams.
This probably won't introduce anything breaking because path.resolve
would still work when dirname is provided.
It's fine. I know about your exams. This probably won't introduce anything breaking because
path.resolve
would still work when dirname is provided.
Even when appended with the current working directory?
Even when appended with the current working directory?
@notunderctrl Yeah, path.resolve is pretty good at this. Here's how I tested it:
const path = require('path');
const getPath = (p) => path.resolve(process.cwd(), p);
console.log(getPath('./src')); // Full path
console.log(getPath(`${__dirname}/src`)); // Full path
I used
path.resolve
with the current working directory and the constructor options. This is easier for ESM projects, since you don't have to declare a dirname variable and can just type./src/commands
for example.I've also used Prettier to format a _meta.json file, so new documentation pages can be added successfully.