Skip to content

Commit

Permalink
fix: windicss extraction on frontmatter
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 2, 2021
1 parent 298218a commit 960c499
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"typeit": "^7.0.4",
"typescript": "^4.2.4",
"typewriter-effect": "^2.17.0",
"vite-plugin-windicss": "^0.16.0-beta.7",
"vite-plugin-windicss": "^0.16.0-beta.8",
"vitepress": "^0.13.2"
}
}
2 changes: 1 addition & 1 deletion packages/slidev/node/plugins/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRo
const a = data.slides[i]
const b = newData.slides[i]

if (a?.content.trim() === b?.content.trim())
if (a?.content.trim() === b?.content.trim() && JSON.stringify(a.frontmatter) === JSON.stringify(b.frontmatter))
continue

moduleIds.push(
Expand Down
32 changes: 16 additions & 16 deletions packages/slidev/node/plugins/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@ export async function ViteSlidevPlugin(
}

return [
WindiCSS(
{
configFiles: [
...defaultConfigureFiles,
...themeRoots.map(i => `${i}/windi.config.ts`),
resolve(clientRoot, 'windi.config.ts'),
],
...windiOptions,
},
{
hookOptions: {
ignoreNodeModules: false,
},
},
),

<Plugin>{
name: 'slidev:flags',
enforce: 'pre',
Expand Down Expand Up @@ -159,22 +175,6 @@ export async function ViteSlidevPlugin(
...iconsOptions,
}),

WindiCSS(
{
configFiles: [
...defaultConfigureFiles,
...themeRoots.map(i => `${i}/windi.config.ts`),
resolve(clientRoot, 'windi.config.ts'),
],
...windiOptions,
},
{
hookOptions: {
ignoreNodeModules: false,
},
},
),

(config.remoteAssets === true || config.remoteAssets === mode)
? RemoteAssets({
rules: [
Expand Down
2 changes: 1 addition & 1 deletion packages/slidev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"vite-plugin-icons": "^0.5.0",
"vite-plugin-md": "^0.6.3",
"vite-plugin-remote-assets": "^0.2.0",
"vite-plugin-windicss": "^0.16.0-beta.7",
"vite-plugin-windicss": "^0.16.0-beta.8",
"vue": "^3.0.11",
"windicss": "^3.0.0-beta.5",
"yargs": "^16.2.0"
Expand Down
24 changes: 12 additions & 12 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 960c499

Please sign in to comment.