Skip to content

Commit

Permalink
Support strict dependency install for image integration (#5034)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Oct 10, 2022
1 parent 19a7688 commit 2d9d422
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-laws-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/image': patch
---

Support strict dependency install
2 changes: 1 addition & 1 deletion packages/integrations/image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@altano/tiny-async-pool": "^1.0.2",
"http-cache-semantics": "^4.1.0",
"image-size": "^1.0.2",
"kleur": "^4.1.5",
"magic-string": "^0.25.9",
"mime": "^3.0.0",
"slash": "^4.0.0"
Expand All @@ -57,7 +58,6 @@
"astro-scripts": "workspace:*",
"chai": "^4.3.6",
"cheerio": "^1.0.0-rc.11",
"kleur": "^4.1.4",
"mocha": "^9.2.2",
"rollup-plugin-copy": "^3.4.0",
"sharp": "^0.31.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/integrations/image/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ export default function integration(options: IntegrationOptions = {}): AstroInte
function getViteConfiguration() {
return {
plugins: [createPlugin(_config, resolvedOptions)],
optimizeDeps: {
include: ['image-size'].filter(Boolean),
},
build: {
rollupOptions: {
external: ['sharp'],
},
},
ssr: {
noExternal: ['@astrojs/image', resolvedOptions.serviceEntryPoint],
// CJS dependencies used by `serviceEntryPoint`
external: ['http-cache-semantics', 'image-size', 'mime'],
},
assetsInclude: ['**/*.wasm'],
};
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2d9d422

Please sign in to comment.