@uni-helper/vite-plugin-uni-pages 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,6 +19,7 @@ pnpm i -D @uni-helper/vite-plugin-uni-pages
19
19
  import { defineConfig } from 'vite'
20
20
  import Uni from '@dcloudio/vite-plugin-uni'
21
21
  import UniPages from '@uni-helper/vite-plugin-uni-pages'
22
+
22
23
  // It is recommended to put it in front of Uni
23
24
  export default defineConfig({
24
25
  plugins: [UniPages(), Uni()],
package/dist/index.cjs CHANGED
@@ -221,12 +221,10 @@ ${err.message}`
221
221
  );
222
222
  }
223
223
  }
224
- if (content) {
225
- return {
226
- attr,
227
- content
228
- };
229
- }
224
+ return {
225
+ attr,
226
+ content: content ?? {}
227
+ };
230
228
  }
231
229
  async function getRouteBlock(path, options) {
232
230
  const content = fs__default.readFileSync(path, "utf8");
package/dist/index.mjs CHANGED
@@ -207,12 +207,10 @@ ${err.message}`
207
207
  );
208
208
  }
209
209
  }
210
- if (content) {
211
- return {
212
- attr,
213
- content
214
- };
215
- }
210
+ return {
211
+ attr,
212
+ content: content ?? {}
213
+ };
216
214
  }
217
215
  async function getRouteBlock(path, options) {
218
216
  const content = fs.readFileSync(path, "utf8");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uni-helper/vite-plugin-uni-pages",
3
3
  "type": "module",
4
- "version": "0.2.0",
4
+ "version": "0.2.2",
5
5
  "description": "File system based routing for uni-app applications using Vite",
6
6
  "author": "KeJun",
7
7
  "license": "MIT",