Skip to content

Commit

Permalink
chore: fix running docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki committed Dec 22, 2022
1 parent 915f23c commit 584a717
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@anu-vue/preset-theme-default/dist/styles.scss'
import '@anu-vue/preset-theme-default/dist/style.scss'
import { anu } from 'anu-vue'
import 'anu-vue/dist/style.css'
import 'uno.css'
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
import 'anu-vue/dist/style.css'
// default theme styles
import '@anu-vue/preset-theme-default/dist/styles.css'
import '@anu-vue/preset-theme-default/dist/style.css'
// Using `app.use(anu)` will register all the components globally
createApp(App)
Expand Down Expand Up @@ -227,7 +227,7 @@ You can also follow À la carte fashion if you don't want to register all the co
export default defineNuxtConfig({
modules: ['@anu-vue/nuxt', '@unocss/nuxt'],
+ css: ['@anu-vue/preset-theme-default/dist/styles.css'],
+ css: ['@anu-vue/preset-theme-default/dist/style.css'],
})
```
Expand Down
2 changes: 1 addition & 1 deletion packages/anu-nuxt/playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import anu from '..'

export default defineNuxtConfig({
modules: [anu, '@unocss/nuxt'],
css: ['@anu-vue/preset-theme-default/dist/styles.scss'],
css: ['@anu-vue/preset-theme-default/dist/style.scss'],
})
20 changes: 10 additions & 10 deletions packages/preset-theme-default/build.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs-extra'
import scss from 'rollup-plugin-scss'
import sass from 'sass'
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
Expand All @@ -18,15 +18,15 @@ export default defineBuildConfig({
],
hooks: {
'mkdist:done': () => {
fs.copyFileSync('src/scss/index.scss', 'dist/styles.scss')
},
'rollup:options': (ctx, rollupOptions) => {
rollupOptions.plugins = rollupOptions.plugins || []
if (Array.isArray(rollupOptions.plugins)) {
rollupOptions.plugins.push(scss({
output: 'dist/styles.css',
}))
}
fs.copyFileSync('src/scss/index.scss', 'dist/style.scss')

const compiledSass = sass.compile('./src/scss/index.scss', { style: 'compressed' })

fs.writeFileSync(
'dist/style.css',
compiledSass.css,
{ encoding: 'utf-8' },
)
},
},
})
6 changes: 3 additions & 3 deletions packages/preset-theme-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./dist/styles.css": "./dist/styles.css",
"./dist/styles.scss": "./dist/styles.scss"
"./dist/style.css": "./dist/style.css",
"./dist/style.scss": "./dist/style.scss"
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
Expand Down Expand Up @@ -53,4 +53,4 @@
"fs-extra": "^11.1.0",
"rollup-plugin-scss": "3"
}
}
}

0 comments on commit 584a717

Please sign in to comment.