Skip to content

Commit c58d8d2

Browse files
committed
fix: update import paths for styles in documentation and package configuration
1 parent 3e7eb56 commit c58d8d2

File tree

4 files changed

+11
-20
lines changed

4 files changed

+11
-20
lines changed

docs/en/guide/getting-started.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If you're not concerned about the final bundle size, using full import is more c
2929
import StarterLibVue3 from 'starter-lib-vue3'
3030
import { createApp } from 'vue'
3131
import App from './App.vue'
32-
import 'starter-lib-vue3/style.css'
32+
import 'starter-lib-vue3/style'
3333

3434
const app = createApp(App)
3535

@@ -93,7 +93,7 @@ Now you can directly use starter-lib-vue3 components in SFC files, and their sty
9393
<script>
9494
// No need to manually import :P
9595
// import { StSayHello } from 'starter-lib-vue3'
96-
// import 'starter-lib-vue3/dist/es/say-hello/SayHello.css'
96+
// import 'starter-lib-vue3/dist/es/say-hello/style.css'
9797
</script>
9898
9999
<template>
@@ -108,7 +108,7 @@ You can manually import the components you need (components consist of logic fil
108108
```vue
109109
<script>
110110
import { StSayHello } from 'starter-lib-vue3'
111-
import 'starter-lib-vue3/dist/es/say-hello/SayHello.css'
111+
import 'starter-lib-vue3/dist/es/say-hello/style.css'
112112
113113
export default {
114114
components: { StSayHello },
@@ -138,14 +138,12 @@ Different CDN providers have different import methods. Here we use unpkg as an e
138138
<meta charset="UTF-8">
139139
<meta name="viewport" content="width=device-width, initial-scale=1.0">
140140
<title>starter-lib-vue3</title>
141-
<link rel="stylesheet" href="https://unpkg.com/starter-lib-vue3/dist/style.css">
142141
</head>
143142

144143
<body>
145144
<div id="app"></div>
146145

147146
<script src="https://unpkg.com/starter-lib-vue3"></script>
148-
<script src="./wxdata-ui.umd.cjs"></script>
149147
<script>
150148
const app = Vue.createApp({
151149
template: '<StSayHello name="Kieran" />'

docs/zh/guide/getting-started.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pnpm install starter-lib-vue3
2929
import StarterLibVue3 from 'starter-lib-vue3'
3030
import { createApp } from 'vue'
3131
import App from './App.vue'
32-
import 'starter-lib-vue3/style.css'
32+
import 'starter-lib-vue3/style'
3333

3434
const app = createApp(App)
3535

@@ -93,7 +93,7 @@ export default defineConfig({
9393
<script>
9494
// 无需手动引入 :P
9595
// import { StSayHello } from 'starter-lib-vue3'
96-
// import 'starter-lib-vue3/dist/es/say-hello/SayHello.css'
96+
// import 'starter-lib-vue3/dist/es/say-hello/style.css'
9797
</script>
9898
9999
<template>
@@ -108,7 +108,7 @@ export default defineConfig({
108108
```vue
109109
<script>
110110
import { StSayHello } from 'starter-lib-vue3'
111-
import 'starter-lib-vue3/dist/es/say-hello/SayHello.css'
111+
import 'starter-lib-vue3/dist/es/say-hello/style.css'
112112
113113
export default {
114114
components: { StSayHello },
@@ -138,14 +138,12 @@ export default {
138138
<meta charset="UTF-8">
139139
<meta name="viewport" content="width=device-width, initial-scale=1.0">
140140
<title>starter-lib-vue3</title>
141-
<link rel="stylesheet" href="https://unpkg.com/starter-lib-vue3/dist/style.css">
142141
</head>
143142

144143
<body>
145144
<div id="app"></div>
146145

147146
<script src="https://unpkg.com/starter-lib-vue3"></script>
148-
<script src="./wxdata-ui.umd.cjs"></script>
149147
<script>
150148
const app = Vue.createApp({
151149
template: '<StSayHello name="Kieran" />'

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@
2727
".": {
2828
"types": "./dist/es/index.d.ts",
2929
"import": "./dist/es/index.js",
30-
"require": "./dist/lib/index.cjs"
30+
"require": "./dist/lib/index.js"
3131
},
3232
"./*": "./*",
33-
"./volar": "./dist/volar.d.ts"
33+
"./volar": "./dist/volar.d.ts",
34+
"./style": "./dist/es/style.css"
3435
},
35-
"main": "dist/lib/index.cjs",
36+
"main": "dist/lib/index.js",
3637
"module": "dist/es/index.js",
3738
"unpkg": "dist/umd/index.js",
3839
"jsdelivr": "dist/umd/index.js",
@@ -85,7 +86,7 @@
8586
"typescript": "^5.8.3",
8687
"unplugin-vue-components": "^28.5.0",
8788
"vite": "^6.3.5",
88-
"vite-plugin-bundle-styles": "0.1.0-beta.1",
89+
"vite-plugin-bundle-styles": "^0.1.0",
8990
"vite-plugin-dts": "^4.5.3",
9091
"vite-plugin-static-copy": "^2.3.1",
9192
"vitepress": "^1.6.3",

vite.config.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,6 @@ export default defineConfig({
110110
globals: {
111111
vue: 'Vue',
112112
},
113-
assetFileNames: (assetInfo) => {
114-
if (assetInfo.names && assetInfo.names.some(name => name.endsWith('.css'))) {
115-
return path.join(path.dirname(assetInfo.names[0]), 'style.css')
116-
}
117-
return '[name].[ext]'
118-
},
119113
},
120114
],
121115
},

0 commit comments

Comments
 (0)