create-portfoliable 1.2.17 → 1.2.18
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/cli/portfoliable.mjs +11 -3
- package/package.json +1 -1
- package/vite.config.js +2 -2
package/cli/portfoliable.mjs
CHANGED
|
@@ -28,6 +28,14 @@ import {
|
|
|
28
28
|
} from '../scripts/terminal-ui.mjs';
|
|
29
29
|
import { resolveConsumerRuntimeAliases } from '../scripts/consumer-runtime-aliases.mjs';
|
|
30
30
|
|
|
31
|
+
function resolveMermaidDevAliases(runtimeAliases) {
|
|
32
|
+
return [
|
|
33
|
+
...runtimeAliases,
|
|
34
|
+
{ find: /^dayjs$/, replacement: path.resolve(process.cwd(), 'node_modules/dayjs/esm/index.js') },
|
|
35
|
+
{ find: 'dayjs/dayjs.min.js', replacement: path.resolve(process.cwd(), 'node_modules/dayjs/esm/index.js') }
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
// MARK: TERMINAL STYLES
|
|
32
40
|
// ANSI color code used for success-status text.
|
|
33
41
|
const green = '\x1b[32m';
|
|
@@ -595,13 +603,13 @@ async function runDevServer(flags, options = {}) {
|
|
|
595
603
|
}
|
|
596
604
|
|
|
597
605
|
const runtimeAliases = resolveConsumerRuntimeAliases(process.cwd());
|
|
606
|
+
const mermaidDevAliases = resolveMermaidDevAliases(runtimeAliases);
|
|
598
607
|
|
|
599
608
|
// Creates Vite development server instance.
|
|
600
609
|
const server = await createServer({
|
|
601
|
-
resolve:
|
|
602
|
-
? { alias: runtimeAliases }
|
|
603
|
-
: undefined,
|
|
610
|
+
resolve: { alias: mermaidDevAliases },
|
|
604
611
|
optimizeDeps: {
|
|
612
|
+
include: ['mermaid', 'mermaid > dayjs'],
|
|
605
613
|
exclude: ['create-portfoliable']
|
|
606
614
|
},
|
|
607
615
|
server: {
|
package/package.json
CHANGED
package/vite.config.js
CHANGED
|
@@ -94,8 +94,8 @@ export default defineConfig(({ command }) => {
|
|
|
94
94
|
? { alias: runtimeAliases }
|
|
95
95
|
: undefined,
|
|
96
96
|
|
|
97
|
-
//
|
|
98
|
-
//
|
|
97
|
+
// Keep Mermaid's CommonJS dependencies in Vite's normalized dev graph while
|
|
98
|
+
// avoiding prebundling Valence so linked-package edits remain observable.
|
|
99
99
|
optimizeDeps: (command === 'serve' && usingLocalValence)
|
|
100
100
|
? { exclude: ['@portfoliablejs/valence'] }
|
|
101
101
|
: undefined,
|