@content-collections/vite 0.2.3 → 0.2.4
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +6 -0
- package/dist/index.js +4 -3
- package/package.json +2 -2
- package/src/index.ts +5 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @content-collections/vite@0.2.
|
|
2
|
+
> @content-collections/vite@0.2.4 build /home/runner/work/content-collections/content-collections/packages/vite
|
|
3
3
|
> tsup src/index.ts --format esm --dts -d dist
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
[34mCLI[39m tsup v8.2.4
|
|
8
8
|
[34mCLI[39m Target: es2022
|
|
9
9
|
[34mESM[39m Build start
|
|
10
|
-
[32mESM[39m [1mdist/index.js [22m[32m2.
|
|
11
|
-
[32mESM[39m ⚡️ Build success in
|
|
10
|
+
[32mESM[39m [1mdist/index.js [22m[32m2.08 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 42ms
|
|
12
12
|
[34mDTS[39m Build start
|
|
13
|
-
[32mDTS[39m ⚡️ Build success in
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 3173ms
|
|
14
14
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m279.00 B[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @content-collections/vite
|
|
2
2
|
|
|
3
|
+
## 0.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#458](https://github.com/sdorra/content-collections/pull/458) [`3abd5c0`](https://github.com/sdorra/content-collections/commit/3abd5c07774662929351de82071600f082d2650d) Thanks [@sdorra](https://github.com/sdorra)! - Fix double execution with vinxi
|
|
8
|
+
|
|
3
9
|
## 0.2.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -14,11 +14,12 @@ function resolveConfigPath(root, configPath) {
|
|
|
14
14
|
function contentCollectionsPlugin(options = {}) {
|
|
15
15
|
const pluginOptions = { ...defaultOptions, ...options };
|
|
16
16
|
let builder;
|
|
17
|
-
|
|
17
|
+
function isEnabled(config) {
|
|
18
|
+
return options.isEnabled ? options.isEnabled(config) : true;
|
|
19
|
+
}
|
|
18
20
|
return {
|
|
19
21
|
name: "content-collections",
|
|
20
22
|
config(config) {
|
|
21
|
-
isEnabled = options.isEnabled ? options.isEnabled(config) : true;
|
|
22
23
|
let configPath = resolveConfigPath(
|
|
23
24
|
config.root || process.cwd(),
|
|
24
25
|
pluginOptions.configPath
|
|
@@ -47,7 +48,7 @@ function contentCollectionsPlugin(options = {}) {
|
|
|
47
48
|
return configPatch;
|
|
48
49
|
},
|
|
49
50
|
async configResolved(config) {
|
|
50
|
-
if (!isEnabled) {
|
|
51
|
+
if (!isEnabled(config)) {
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
53
54
|
let configPath = resolveConfigPath(config.root, pluginOptions.configPath);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@content-collections/vite",
|
|
3
3
|
"description": "Use content-collections with Vite",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"tsup": "^8.2.4",
|
|
21
21
|
"typescript": "^5.5.4",
|
|
22
22
|
"vite": "^5.4.6",
|
|
23
|
-
"@content-collections/core": "0.
|
|
23
|
+
"@content-collections/core": "0.8.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@content-collections/core": "^0.x",
|
package/src/index.ts
CHANGED
|
@@ -25,14 +25,15 @@ export default function contentCollectionsPlugin(
|
|
|
25
25
|
const pluginOptions = { ...defaultOptions, ...options };
|
|
26
26
|
|
|
27
27
|
let builder: Builder;
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
function isEnabled(config: UserConfig) {
|
|
30
|
+
return options.isEnabled ? options.isEnabled(config) : true;
|
|
31
|
+
}
|
|
29
32
|
|
|
30
33
|
return {
|
|
31
34
|
name: "content-collections",
|
|
32
35
|
|
|
33
36
|
config(config) {
|
|
34
|
-
isEnabled = options.isEnabled ? options.isEnabled(config) : true;
|
|
35
|
-
|
|
36
37
|
// even if the plugin is disabled, we need to configure the alias
|
|
37
38
|
// vite is often executed multiple time and the plugin should only
|
|
38
39
|
// run once, but the aliases must be available for all runs
|
|
@@ -71,7 +72,7 @@ export default function contentCollectionsPlugin(
|
|
|
71
72
|
},
|
|
72
73
|
|
|
73
74
|
async configResolved(config: any) {
|
|
74
|
-
if (!isEnabled) {
|
|
75
|
+
if (!isEnabled(config)) {
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
78
|
let configPath = resolveConfigPath(config.root, pluginOptions.configPath);
|