@md-plugins/vite-examples-plugin 0.1.0-beta.8 → 0.1.0-rc.0

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
@@ -16,6 +16,8 @@ Install the plugin via your preferred package manager:
16
16
  ```bash
17
17
  # with pnpm
18
18
  pnpm add @md-plugins/vite-examples-plugin
19
+ # with bun
20
+ bun add @md-plugins/vite-examples-plugin
19
21
  # with yarn
20
22
  yarn add @md-plugins/vite-examples-plugin
21
23
  # with npm
@@ -188,8 +190,8 @@ export const source = import.meta.glob('/src/examples/example1/*.vue', {
188
190
  In production, the plugin preloads example components and their raw source code, generating import and export statements:
189
191
 
190
192
  ```ts
191
- import Example1 from 'app/src/examples/example1/Example1.vue'
192
- import RawExample1 from 'app/src/examples/example1/Example1.vue?raw'
193
+ import Example1 from '@/examples/example1/Example1.vue'
194
+ import RawExample1 from '@/examples/example1/Example1.vue?raw'
193
195
 
194
196
  export { Example1, RawExample1 }
195
197
  ```
@@ -222,6 +224,13 @@ throw new Error('targetFolder is not defined')
222
224
 
223
225
  In case this README falls out of date, please refer to the [documentation](https://md-plugins.netlify.app/vite-plugins/vite-examples-plugin/overview) for the latest information.
224
226
 
227
+ ## Support
228
+
229
+ If vite-examples-plugin is useful in your workflow and you want to support ongoing maintenance:
230
+
231
+ - GitHub Sponsors: https://github.com/sponsors/hawkeye64
232
+ - PayPal: https://paypal.me/hawkeye64
233
+
225
234
  ## License
226
235
 
227
236
  This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.
package/dist/index.mjs CHANGED
@@ -7,8 +7,8 @@ let targetFolder = "";
7
7
  function devLoad(id) {
8
8
  if (id.startsWith(resolvedIdPrefix)) {
9
9
  const query = `'/src/examples/${id.substring(id.indexOf(":") + 1)}/*.vue'`;
10
- return `export const code = import.meta.glob(${query}, { eager: true })
11
- export const source = import.meta.glob(${query}, { query: '?raw', import: 'default', eager: true })`;
10
+ return `export const code = import.meta.glob(${query})
11
+ export const source = import.meta.glob(${query}, { query: '?raw', import: 'default' })`;
12
12
  }
13
13
  return void 0;
14
14
  }
@@ -18,8 +18,8 @@ function prodLoad(id) {
18
18
  const files = globSync("*.vue", { cwd: join(targetFolder, exampleId) });
19
19
  const importList = files.map((entry) => entry.substring(0, entry.length - 4));
20
20
  const importStatements = importList.map(
21
- (entry) => `import ${entry} from 'app/src/examples/${exampleId}/${entry}.vue'
22
- import Raw${entry} from 'app/src/examples/${exampleId}/${entry}.vue?raw'`
21
+ (entry) => `import ${entry} from '@/examples/${exampleId}/${entry}.vue'
22
+ import Raw${entry} from '@/examples/${exampleId}/${entry}.vue?raw'`
23
23
  ).join("\n");
24
24
  const exportStatements = importList.map((entry) => `${entry},Raw${entry}`).join(",");
25
25
  return importStatements + `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@md-plugins/vite-examples-plugin",
3
- "version": "0.1.0-beta.8",
3
+ "version": "0.1.0-rc.0",
4
4
  "description": "A Vite plugin for @md-plugins for handling imported examples in markdown files.",
5
5
  "keywords": [
6
6
  "markdown-it",
@@ -38,10 +38,10 @@
38
38
  "access": "public"
39
39
  },
40
40
  "dependencies": {
41
- "tinyglobby": "^0.2.16"
41
+ "tinyglobby": "^0.2.17"
42
42
  },
43
43
  "devDependencies": {
44
- "vite": "^8.0.14"
44
+ "vite": "^8.0.16"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "unbuild",