@md-plugins/vite-examples-plugin 0.1.0-alpha.9 → 0.1.0-beta.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 +31 -19
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +1 -1
- package/package.json +14 -12
package/README.md
CHANGED
|
@@ -14,14 +14,12 @@ A Vite plugin that facilitates handling Vue example files in both development an
|
|
|
14
14
|
Install the plugin via your preferred package manager:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
#
|
|
18
|
-
npm install @md-plugins/vite-examples-plugin
|
|
19
|
-
|
|
20
|
-
# yarn
|
|
21
|
-
yarn add @md-plugins/vite-examples-plugin
|
|
22
|
-
|
|
23
|
-
# pnpm
|
|
17
|
+
# with pnpm
|
|
24
18
|
pnpm add @md-plugins/vite-examples-plugin
|
|
19
|
+
# with yarn
|
|
20
|
+
yarn add @md-plugins/vite-examples-plugin
|
|
21
|
+
# with npm
|
|
22
|
+
npm install @md-plugins/vite-examples-plugin
|
|
25
23
|
```
|
|
26
24
|
|
|
27
25
|
## Usage
|
|
@@ -33,13 +31,16 @@ To use the `viteExamplesPlugin`, configure it in your Vite project:
|
|
|
33
31
|
```typescript
|
|
34
32
|
import { defineConfig } from 'vite'
|
|
35
33
|
import vue from '@vitejs/plugin-vue'
|
|
36
|
-
import { viteExamplesPlugin, viteManualChunks } from 'vite-examples-plugin'
|
|
34
|
+
import { viteExamplesPlugin, viteManualChunks } from '@md-plugins/vite-examples-plugin'
|
|
37
35
|
|
|
38
36
|
export default defineConfig(({ mode }) => {
|
|
39
37
|
const isProduction = mode === 'production'
|
|
40
38
|
|
|
41
39
|
return {
|
|
42
|
-
plugins: [
|
|
40
|
+
plugins: [
|
|
41
|
+
vue(),
|
|
42
|
+
viteExamplesPlugin({ isProd: isProduction, path: '/absolute/path/to/examples' }),
|
|
43
|
+
],
|
|
43
44
|
}
|
|
44
45
|
})
|
|
45
46
|
```
|
|
@@ -49,15 +50,22 @@ export default defineConfig(({ mode }) => {
|
|
|
49
50
|
```js
|
|
50
51
|
import { defineConfig } from 'vite'
|
|
51
52
|
import vue from '@vitejs/plugin-vue'
|
|
52
|
-
import { viteExamplesPlugin, viteManualChunks } from 'vite-examples-plugin'
|
|
53
|
+
import { viteExamplesPlugin, viteManualChunks } from '@md-plugins/vite-examples-plugin'
|
|
53
54
|
|
|
54
|
-
export default defineConfig({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
export default defineConfig(({ mode }) => {
|
|
56
|
+
const isProduction = mode === 'production'
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
plugins: [
|
|
60
|
+
vue(),
|
|
61
|
+
viteExamplesPlugin({ isProd: isProduction, path: '/absolute/path/to/examples' }),
|
|
62
|
+
],
|
|
63
|
+
build: {
|
|
64
|
+
chunkSizeWarningLimit: 650,
|
|
65
|
+
rollupOptions: {
|
|
66
|
+
output: {
|
|
67
|
+
manualChunks: viteManualChunks,
|
|
68
|
+
},
|
|
61
69
|
},
|
|
62
70
|
},
|
|
63
71
|
},
|
|
@@ -69,7 +77,7 @@ export default defineConfig({
|
|
|
69
77
|
1. Update `quasar.config.(js|ts)`:
|
|
70
78
|
|
|
71
79
|
```js
|
|
72
|
-
import { viteExamplesPlugin } from '@md-
|
|
80
|
+
import { viteExamplesPlugin } from '@md-plugins/vite-examples-plugin'
|
|
73
81
|
|
|
74
82
|
export default defineConfig((ctx) => {
|
|
75
83
|
// ...
|
|
@@ -78,7 +86,7 @@ export default defineConfig((ctx) => {
|
|
|
78
86
|
```js
|
|
79
87
|
build: {
|
|
80
88
|
vitePlugins: [
|
|
81
|
-
viteExamplesPlugin(ctx.isProd, ctx.appPaths.srcDir + '/examples'),
|
|
89
|
+
viteExamplesPlugin({ isProd: ctx.isProd, path: ctx.appPaths.srcDir + '/examples' }),
|
|
82
90
|
// ...
|
|
83
91
|
],
|
|
84
92
|
},
|
|
@@ -198,6 +206,10 @@ If the `targetFolder` is not defined when the plugin is initialized, an error wi
|
|
|
198
206
|
throw new Error('targetFolder is not defined')
|
|
199
207
|
```
|
|
200
208
|
|
|
209
|
+
## Documentation
|
|
210
|
+
|
|
211
|
+
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.
|
|
212
|
+
|
|
201
213
|
## License
|
|
202
214
|
|
|
203
215
|
This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.
|
package/dist/index.d.mts
CHANGED
|
@@ -20,7 +20,10 @@ import { Plugin } from 'vite';
|
|
|
20
20
|
* The `resolveId` property resolves module IDs starting with "examples:" and returns a resolved ID.
|
|
21
21
|
* The `load` property loads example code based on the production or development environment.
|
|
22
22
|
*/
|
|
23
|
-
declare function viteExamplesPlugin(isProd
|
|
23
|
+
declare function viteExamplesPlugin({ isProd, path }: {
|
|
24
|
+
isProd: boolean;
|
|
25
|
+
path: string;
|
|
26
|
+
}): Plugin;
|
|
24
27
|
|
|
25
28
|
/**
|
|
26
29
|
* A function to determine the manual chunk name for a given module ID.
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,10 @@ import { Plugin } from 'vite';
|
|
|
20
20
|
* The `resolveId` property resolves module IDs starting with "examples:" and returns a resolved ID.
|
|
21
21
|
* The `load` property loads example code based on the production or development environment.
|
|
22
22
|
*/
|
|
23
|
-
declare function viteExamplesPlugin(isProd
|
|
23
|
+
declare function viteExamplesPlugin({ isProd, path }: {
|
|
24
|
+
isProd: boolean;
|
|
25
|
+
path: string;
|
|
26
|
+
}): Plugin;
|
|
24
27
|
|
|
25
28
|
/**
|
|
26
29
|
* A function to determine the manual chunk name for a given module ID.
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@md-plugins/vite-examples-plugin",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-beta.0",
|
|
4
4
|
"description": "A Vite plugin for @md-plugins for handling imported examples in markdown files.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown-it",
|
|
7
7
|
"quasarframework",
|
|
8
|
-
"vue",
|
|
9
8
|
"utils",
|
|
10
9
|
"vite",
|
|
11
|
-
"vite-plugin"
|
|
10
|
+
"vite-plugin",
|
|
11
|
+
"vue"
|
|
12
12
|
],
|
|
13
13
|
"homepage": "https://github.com/md-plugins",
|
|
14
14
|
"bugs": {
|
|
15
15
|
"url": "https://github.com/md-plugins/md-plugins/issues"
|
|
16
16
|
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "hawkeye64 <galbraith64@gmail.com>",
|
|
17
19
|
"repository": {
|
|
18
20
|
"type": "git",
|
|
19
21
|
"url": "git+https://github.com/md-plugins/md-plugins.git"
|
|
20
22
|
},
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
+
"files": [
|
|
24
|
+
"./dist"
|
|
25
|
+
],
|
|
23
26
|
"type": "module",
|
|
27
|
+
"module": "./dist/index.mjs",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
24
29
|
"exports": {
|
|
25
30
|
".": {
|
|
26
31
|
"import": {
|
|
@@ -29,17 +34,14 @@
|
|
|
29
34
|
}
|
|
30
35
|
}
|
|
31
36
|
},
|
|
32
|
-
"module": "./dist/index.mjs",
|
|
33
|
-
"types": "./dist/index.d.ts",
|
|
34
|
-
"files": [
|
|
35
|
-
"./dist"
|
|
36
|
-
],
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"tinyglobby": "^0.2.16"
|
|
42
|
+
},
|
|
40
43
|
"devDependencies": {
|
|
41
|
-
"
|
|
42
|
-
"vite": "^6.0.7"
|
|
44
|
+
"vite": "^8.0.12"
|
|
43
45
|
},
|
|
44
46
|
"scripts": {
|
|
45
47
|
"build": "unbuild",
|