sveltekit-data-plugin 1.4.1 → 1.4.5
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/dist/plugin.js +12 -2
- package/dist/plugin.mjs +12 -2
- package/package.json +3 -2
package/dist/plugin.js
CHANGED
|
@@ -130,10 +130,20 @@
|
|
|
130
130
|
var _a;
|
|
131
131
|
if (/\.(md)$/.test(id)) {
|
|
132
132
|
const base2 = path.resolve(((_a = opts.vite_config) == null ? void 0 : _a.root) ?? "", opts.base);
|
|
133
|
+
const relativeFolder = id.replace(`/${path.basename(id)}`, "");
|
|
133
134
|
const d = fm(src);
|
|
134
|
-
const attributes = await convert(opts, d.attributes, {
|
|
135
|
+
const attributes = await convert(opts, d.attributes, {
|
|
136
|
+
base: base2,
|
|
137
|
+
relative: relativeFolder
|
|
138
|
+
});
|
|
135
139
|
return `
|
|
136
|
-
${Object.entries(
|
|
140
|
+
${Object.entries({
|
|
141
|
+
...attributes,
|
|
142
|
+
_internal: {
|
|
143
|
+
id: path.basename(id),
|
|
144
|
+
absolute: id
|
|
145
|
+
}
|
|
146
|
+
}).map(([key, value]) => `export const ${key} = ${JSON.stringify(value)};`).join("\n")}
|
|
137
147
|
export const body = ${JSON.stringify(d.body)};`;
|
|
138
148
|
}
|
|
139
149
|
}
|
package/dist/plugin.mjs
CHANGED
|
@@ -129,10 +129,20 @@ function importDataPlugin(imagetools_plugin, { base = "./src/data" } = {}) {
|
|
|
129
129
|
var _a;
|
|
130
130
|
if (/\.(md)$/.test(id)) {
|
|
131
131
|
const base2 = path.resolve(((_a = opts.vite_config) == null ? void 0 : _a.root) ?? "", opts.base);
|
|
132
|
+
const relativeFolder = id.replace(`/${path.basename(id)}`, "");
|
|
132
133
|
const d = fm(src);
|
|
133
|
-
const attributes = await convert(opts, d.attributes, {
|
|
134
|
+
const attributes = await convert(opts, d.attributes, {
|
|
135
|
+
base: base2,
|
|
136
|
+
relative: relativeFolder
|
|
137
|
+
});
|
|
134
138
|
return `
|
|
135
|
-
${Object.entries(
|
|
139
|
+
${Object.entries({
|
|
140
|
+
...attributes,
|
|
141
|
+
_internal: {
|
|
142
|
+
id: path.basename(id),
|
|
143
|
+
absolute: id
|
|
144
|
+
}
|
|
145
|
+
}).map(([key, value]) => `export const ${key} = ${JSON.stringify(value)};`).join("\n")}
|
|
136
146
|
export const body = ${JSON.stringify(d.body)};`;
|
|
137
147
|
}
|
|
138
148
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sveltekit-data-plugin",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Jonny Thaw",
|
|
6
6
|
"url": "https://jthaw.me"
|
|
@@ -29,5 +29,6 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"front-matter": "^4.0.2"
|
|
32
|
-
}
|
|
32
|
+
},
|
|
33
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
33
34
|
}
|