code-squad-cli 1.2.9 → 1.2.10
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/flip/routes/static.js +8 -4
- package/dist/index.js +4 -1
- package/package.json +1 -1
|
@@ -8,10 +8,14 @@ export function createStaticRouter() {
|
|
|
8
8
|
// Get __dirname equivalent in ESM
|
|
9
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
10
10
|
const __dirname = path.dirname(__filename);
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
// First, check for the bundled path. This is more robust than checking the filename.
|
|
12
|
+
// - Bundled: dist/flip-ui/dist
|
|
13
|
+
let distPath = path.resolve(__dirname, 'flip-ui/dist');
|
|
14
|
+
// If the bundled path doesn't exist, fall back to the unbundled (development) path.
|
|
15
|
+
// - Unbundled: packages/cli/flip-ui/dist
|
|
16
|
+
if (!fs.existsSync(distPath)) {
|
|
17
|
+
distPath = path.resolve(__dirname, '../../../flip-ui/dist');
|
|
18
|
+
}
|
|
15
19
|
// Check if dist exists (for development vs production)
|
|
16
20
|
if (fs.existsSync(distPath)) {
|
|
17
21
|
// Serve static files
|
package/dist/index.js
CHANGED
|
@@ -1106,7 +1106,10 @@ function createStaticRouter() {
|
|
|
1106
1106
|
const router6 = Router6();
|
|
1107
1107
|
const __filename = fileURLToPath(import.meta.url);
|
|
1108
1108
|
const __dirname = path7.dirname(__filename);
|
|
1109
|
-
|
|
1109
|
+
let distPath = path7.resolve(__dirname, "flip-ui/dist");
|
|
1110
|
+
if (!fs7.existsSync(distPath)) {
|
|
1111
|
+
distPath = path7.resolve(__dirname, "../../../flip-ui/dist");
|
|
1112
|
+
}
|
|
1110
1113
|
if (fs7.existsSync(distPath)) {
|
|
1111
1114
|
router6.use(express.static(distPath));
|
|
1112
1115
|
router6.get("*", (req, res) => {
|