vite-plugin-react-deck 1.1.0 → 1.1.1
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/helpers.d.ts +1 -1
- package/index.cjs +10 -10
- package/index.mjs +10 -10
- package/package.json +1 -1
package/helpers.d.ts
CHANGED
package/index.cjs
CHANGED
|
@@ -260,10 +260,11 @@ function createAppDeckFile({
|
|
|
260
260
|
throw new Error(`Theme ${theme} not found`);
|
|
261
261
|
}
|
|
262
262
|
const themeObject = themes_exports[theme];
|
|
263
|
+
const layoutImport = config.layoutsFile ? `import layouts from "${config.layoutsFile}";` : "import { layouts } from '@gpichot/spectacle-deck';";
|
|
263
264
|
return `import React, { StrictMode } from "react";
|
|
264
265
|
import * as ReactDOM from "react-dom/client";
|
|
265
266
|
import { Deck } from '@gpichot/spectacle-deck';
|
|
266
|
-
|
|
267
|
+
${layoutImport};
|
|
267
268
|
|
|
268
269
|
import deck from "${slidePath}";
|
|
269
270
|
|
|
@@ -325,18 +326,16 @@ async function loadCustomConfig() {
|
|
|
325
326
|
};
|
|
326
327
|
}
|
|
327
328
|
var src_default = async (options) => {
|
|
328
|
-
const config = await loadCustomConfig();
|
|
329
|
-
console.log(config);
|
|
330
329
|
let isProd = false;
|
|
331
330
|
const deckConfig = {
|
|
332
331
|
decks: []
|
|
333
332
|
};
|
|
334
333
|
return {
|
|
335
334
|
name: "react-deck",
|
|
336
|
-
async config(
|
|
335
|
+
async config(config) {
|
|
337
336
|
var _a, _b, _c;
|
|
338
337
|
const decks = await glob.glob("./src/**/deck.mdx");
|
|
339
|
-
const inputs = ((_b = (_a =
|
|
338
|
+
const inputs = ((_b = (_a = config.build) == null ? void 0 : _a.rollupOptions) == null ? void 0 : _b.input) || {};
|
|
340
339
|
deckConfig.decks = decks.map((deck) => ({
|
|
341
340
|
originalFile: deck,
|
|
342
341
|
index: deck.replace("/deck.mdx", "/index.html").replace("src/", "")
|
|
@@ -347,18 +346,18 @@ var src_default = async (options) => {
|
|
|
347
346
|
}, []);
|
|
348
347
|
const finalInputs = typeof inputs === "string" ? [inputs, ...decks] : Array.isArray(inputs) ? [...inputs, ...decks] : { ...inputs, ...newInputs };
|
|
349
348
|
return {
|
|
350
|
-
...
|
|
349
|
+
...config,
|
|
351
350
|
build: {
|
|
352
|
-
...
|
|
351
|
+
...config.build,
|
|
353
352
|
rollupOptions: {
|
|
354
|
-
...(_c =
|
|
353
|
+
...(_c = config.build) == null ? void 0 : _c.rollupOptions,
|
|
355
354
|
input: finalInputs
|
|
356
355
|
}
|
|
357
356
|
}
|
|
358
357
|
};
|
|
359
358
|
},
|
|
360
|
-
configResolved(
|
|
361
|
-
isProd =
|
|
359
|
+
configResolved(config) {
|
|
360
|
+
isProd = config.isProduction;
|
|
362
361
|
},
|
|
363
362
|
resolveId(id) {
|
|
364
363
|
if (deckConfig.decks.some((deck) => deck.index === id)) {
|
|
@@ -372,6 +371,7 @@ var src_default = async (options) => {
|
|
|
372
371
|
}
|
|
373
372
|
},
|
|
374
373
|
async load(id) {
|
|
374
|
+
const config = await loadCustomConfig();
|
|
375
375
|
const deck = deckConfig.decks.find((deck2) => deck2.index === id);
|
|
376
376
|
if (deck) {
|
|
377
377
|
return createIndexFile({
|
package/index.mjs
CHANGED
|
@@ -239,10 +239,11 @@ function createAppDeckFile({
|
|
|
239
239
|
throw new Error(`Theme ${theme} not found`);
|
|
240
240
|
}
|
|
241
241
|
const themeObject = themes_exports[theme];
|
|
242
|
+
const layoutImport = config.layoutsFile ? `import layouts from "${config.layoutsFile}";` : "import { layouts } from '@gpichot/spectacle-deck';";
|
|
242
243
|
return `import React, { StrictMode } from "react";
|
|
243
244
|
import * as ReactDOM from "react-dom/client";
|
|
244
245
|
import { Deck } from '@gpichot/spectacle-deck';
|
|
245
|
-
|
|
246
|
+
${layoutImport};
|
|
246
247
|
|
|
247
248
|
import deck from "${slidePath}";
|
|
248
249
|
|
|
@@ -309,18 +310,16 @@ async function loadCustomConfig() {
|
|
|
309
310
|
};
|
|
310
311
|
}
|
|
311
312
|
var src_default = async (options) => {
|
|
312
|
-
const config = await loadCustomConfig();
|
|
313
|
-
console.log(config);
|
|
314
313
|
let isProd = false;
|
|
315
314
|
const deckConfig = {
|
|
316
315
|
decks: []
|
|
317
316
|
};
|
|
318
317
|
return {
|
|
319
318
|
name: "react-deck",
|
|
320
|
-
async config(
|
|
319
|
+
async config(config) {
|
|
321
320
|
var _a, _b, _c;
|
|
322
321
|
const decks = await glob.glob("./src/**/deck.mdx");
|
|
323
|
-
const inputs = ((_b = (_a =
|
|
322
|
+
const inputs = ((_b = (_a = config.build) == null ? void 0 : _a.rollupOptions) == null ? void 0 : _b.input) || {};
|
|
324
323
|
deckConfig.decks = decks.map((deck) => ({
|
|
325
324
|
originalFile: deck,
|
|
326
325
|
index: deck.replace("/deck.mdx", "/index.html").replace("src/", "")
|
|
@@ -331,18 +330,18 @@ var src_default = async (options) => {
|
|
|
331
330
|
}, []);
|
|
332
331
|
const finalInputs = typeof inputs === "string" ? [inputs, ...decks] : Array.isArray(inputs) ? [...inputs, ...decks] : { ...inputs, ...newInputs };
|
|
333
332
|
return {
|
|
334
|
-
...
|
|
333
|
+
...config,
|
|
335
334
|
build: {
|
|
336
|
-
...
|
|
335
|
+
...config.build,
|
|
337
336
|
rollupOptions: {
|
|
338
|
-
...(_c =
|
|
337
|
+
...(_c = config.build) == null ? void 0 : _c.rollupOptions,
|
|
339
338
|
input: finalInputs
|
|
340
339
|
}
|
|
341
340
|
}
|
|
342
341
|
};
|
|
343
342
|
},
|
|
344
|
-
configResolved(
|
|
345
|
-
isProd =
|
|
343
|
+
configResolved(config) {
|
|
344
|
+
isProd = config.isProduction;
|
|
346
345
|
},
|
|
347
346
|
resolveId(id) {
|
|
348
347
|
if (deckConfig.decks.some((deck) => deck.index === id)) {
|
|
@@ -356,6 +355,7 @@ var src_default = async (options) => {
|
|
|
356
355
|
}
|
|
357
356
|
},
|
|
358
357
|
async load(id) {
|
|
358
|
+
const config = await loadCustomConfig();
|
|
359
359
|
const deck = deckConfig.decks.find((deck2) => deck2.index === id);
|
|
360
360
|
if (deck) {
|
|
361
361
|
return createIndexFile({
|