-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Cleanup dependencies #5773
Cleanup dependencies #5773
Conversation
🦋 Changeset detectedLatest commit: f74260e The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
plugins: Postcss.Plugin[]; | ||
} | ||
|
||
async function resolvePostcssConfig(inlineOptions: any, root: URL): Promise<PostCSSConfigResult> { |
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.
This function is unused. The postcss
and postcss-load-config
deps can be removed along.
function getSsrNoExternalDeps(projectRoot: URL): string[] { | ||
let noExternalDeps = []; | ||
for (const dep of ALWAYS_NOEXTERNAL) { | ||
try { | ||
resolveDependency(dep, projectRoot); | ||
noExternalDeps.push(dep); | ||
} catch { | ||
// ignore dependency if *not* installed / present in your project | ||
// prevents hard error from Vite! | ||
} | ||
} | ||
return noExternalDeps; | ||
} |
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.
Vite doesn't have an issue now if the deps are not installed. This enables removing resolveDependency
and the resolve
package.
return npath.posix.join(getRootPath(base), href); | ||
const rootPath = getRootPath(base); | ||
const normalizedHref = slashify(href); | ||
return appendForwardSlash(rootPath) + removeLeadingForwardSlash(normalizedHref); |
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.
This is the only place we use the path-browserify
dep. I've emulated the posix join with this.
For reference, here's it's implementation: https://github.com/browserify/path-browserify/blob/872fec31a8bac7b9b43be0e54ef3037e0202c5fb/index.js#L180-L197
@@ -1,4 +1,4 @@ | |||
import { encode } from 'html-entities'; | |||
import { escape } from 'html-escaper'; |
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.
html-entities
and html-escaper
do the same thing. Since we use html-escaper
more, I've swap to it. html-entities
was only used here once.
const astroServerPath = fileURLToPath( | ||
await importMetaResolve('astro/server/index.js', root.toString()) | ||
); |
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.
This is not needed anymore as I made a change to dedupe astro
, which means we can refer to the string unresolved. We do the same for Astro compile too:
internalURL: 'astro/server/index.js', |
Changes
I wanted to remove more, but the
astro.js
bin script, andastro add
command uses a fair amount of packages that are only used once. And they can't be removed or it'll break the core feature.Testing
Existing tests should pass.
Docs
Internal refactor. n/a