@screenly/edge-apps 0.0.11 → 0.0.13
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'path'
|
|
2
2
|
import { createRequire } from 'module'
|
|
3
3
|
import { fileURLToPath } from 'url'
|
|
4
|
+
import { existsSync } from 'fs'
|
|
4
5
|
|
|
5
6
|
const PREVIEW_PORT = 4173
|
|
6
7
|
|
|
@@ -24,7 +25,10 @@ try {
|
|
|
24
25
|
|
|
25
26
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
26
27
|
const libraryRoot = path.dirname(__dirname)
|
|
27
|
-
const
|
|
28
|
+
const appViteBin = path.resolve(process.cwd(), 'node_modules', '.bin', 'vite')
|
|
29
|
+
const viteBin = existsSync(appViteBin)
|
|
30
|
+
? appViteBin
|
|
31
|
+
: path.resolve(libraryRoot, 'node_modules', '.bin', 'vite')
|
|
28
32
|
const viteConfig = path.resolve(libraryRoot, 'vite.config.ts')
|
|
29
33
|
|
|
30
34
|
export default defineConfig({
|
|
@@ -34,8 +38,6 @@ export default defineConfig({
|
|
|
34
38
|
...devices['Desktop Chrome'],
|
|
35
39
|
},
|
|
36
40
|
webServer: {
|
|
37
|
-
// Invoke vite directly so it always runs from the library's node_modules,
|
|
38
|
-
// ensuring packages like tailwindcss resolve correctly regardless of the app.
|
|
39
41
|
command: `"${viteBin}" build --config "${viteConfig}" && "${viteBin}" preview --config "${viteConfig}" --port ${PREVIEW_PORT} --strictPort`,
|
|
40
42
|
cwd: process.cwd(),
|
|
41
43
|
port: PREVIEW_PORT,
|
package/package.json
CHANGED
package/scripts/cli.ts
CHANGED
|
@@ -224,7 +224,7 @@ async function screenshotsCommand(_args: string[]) {
|
|
|
224
224
|
const playwrightConfig = path.resolve(
|
|
225
225
|
libraryRoot,
|
|
226
226
|
'configs',
|
|
227
|
-
'playwright.
|
|
227
|
+
'playwright.mts',
|
|
228
228
|
)
|
|
229
229
|
execSync(`"${playwrightBin}" test --config "${playwrightConfig}"`, {
|
|
230
230
|
stdio: 'inherit',
|