Skip to content

Commit

Permalink
Merge pull request #30 from barrel/css-hash-fix
Browse files Browse the repository at this point in the history
Entry chunks hash fix
  • Loading branch information
montalvomiguelo committed Jan 12, 2023
2 parents 33a751c + ad71791 commit 0923d26
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 45 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -39,7 +39,7 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"vite": "^4.0.0"
"vite": "^4.0.4"
},
"packageManager": "pnpm@7.1.0"
}
2 changes: 1 addition & 1 deletion packages/vite-plugin-shopify-modules/package.json
Expand Up @@ -29,7 +29,7 @@
"lint": "eslint ."
},
"peerDependencies": {
"vite": "^4.0.0"
"vite": "^4.0.4"
},
"dependencies": {
"chokidar": "^3.5.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-shopify-theme-settings/package.json
Expand Up @@ -30,7 +30,7 @@
"test": "vitest run"
},
"peerDependencies": {
"vite": "^4.0.0"
"vite": "^4.0.4"
},
"dependencies": {
"chokidar": "^3.5.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-shopify/package.json
Expand Up @@ -30,7 +30,7 @@
"test": "vitest run"
},
"peerDependencies": {
"vite": "^4.0.0"
"vite": "^4.0.4"
},
"dependencies": {
"debug": "^4.3.4",
Expand Down
16 changes: 1 addition & 15 deletions packages/vite-plugin-shopify/src/config.ts
@@ -1,5 +1,5 @@
import path from 'path'
import { Plugin, UserConfig, mergeConfig, normalizePath, ChunkMetadata } from 'vite'
import { Plugin, UserConfig, mergeConfig, normalizePath } from 'vite'
import glob from 'fast-glob'
import createDebugger from 'debug'

Expand Down Expand Up @@ -64,20 +64,6 @@ export default function shopifyConfig (options: ResolvedVitePluginShopifyOptions
debug(generatedConfig)

return mergeConfig(generatedConfig, config)
},
// Note: This can be removed once https://github.com/vitejs/vite/issues/9583 is resolved
augmentChunkHash (chunkInfo) {
// @ts-expect-error - Vite extends Rollup's "RenderedChunk" type with additional metadata, but this is not reflected on the Rollup Plugin class' augmentChunkHash argument
const { importedCss, importedAssets } = chunkInfo.viteMetadata as ChunkMetadata

const importedModules = Array.from([
...importedCss,
...importedAssets
])

if (importedModules.length > 0) {
return importedModules.toString()
}
}
}
}
48 changes: 24 additions & 24 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion themes/seed-theme/package.json
Expand Up @@ -48,7 +48,7 @@
"postcss-import": "^14.1.0",
"postcss-mixins": "^9.0.2",
"postcss-preset-env": "^7.4.3",
"vite": "^4.0.0",
"vite": "^4.0.4",
"vite-plugin-shopify": "workspace:*",
"vite-plugin-shopify-modules": "workspace:*",
"vite-plugin-shopify-theme-settings": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion themes/vite-shopify-example/package.json
Expand Up @@ -10,7 +10,7 @@
"cross-env": "^7.0.3",
"sass": "^1.52.2",
"tsconfig": "workspace:*",
"vite": "^4.0.0",
"vite": "^4.0.4",
"vite-plugin-shopify": "workspace:*",
"vite-plugin-shopify-modules": "workspace:*"
},
Expand Down

0 comments on commit 0923d26

Please sign in to comment.