File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 "build:esm" : " KNIGHTED_PRIMARY_CDN=esm npm run build" ,
3333 "build:jspm" : " KNIGHTED_PRIMARY_CDN=jspmGa npm run build" ,
3434 "build:importmap-mode" : " KNIGHTED_PRIMARY_CDN=importMap npm run build" ,
35- "preview" : " KNIGHTED_PRIMARY_CDN=esm npm run build && http-server dist -a localhost -p 8081 -c-1 -o index.html" ,
35+ "preview" : " npm run build && http-server dist -a localhost -p 8081 -c-1 -o index.html" ,
3636 "check-types" : " tsc -p tsconfig.json" ,
3737 "lint:playwright" : " eslint playwright playwright.config.ts" ,
38- "test:e2e" : " KNIGHTED_PRIMARY_CDN=esm npm run build && PLAYWRIGHT_WEB_SERVER_MODE=preview PLAYWRIGHT_PORT=8081 playwright test" ,
38+ "test:e2e" : " npm run build && PLAYWRIGHT_WEB_SERVER_MODE=preview PLAYWRIGHT_PORT=8081 playwright test" ,
3939 "test:e2e:dev" : " playwright test" ,
40- "test:e2e:headed" : " KNIGHTED_PRIMARY_CDN=esm npm run build && PLAYWRIGHT_WEB_SERVER_MODE=preview PLAYWRIGHT_PORT=8081 playwright test --headed" ,
40+ "test:e2e:headed" : " npm run build && PLAYWRIGHT_WEB_SERVER_MODE=preview PLAYWRIGHT_PORT=8081 playwright test --headed" ,
4141 "test" : " echo \" Error: no test specified\" && exit 1" ,
4242 "prettier" : " prettier --write ." ,
4343 "lint" : " oxlint src scripts && npm run lint:playwright"
Original file line number Diff line number Diff line change @@ -30,7 +30,19 @@ const collectJavaScriptFiles = async directory => {
3030
3131 return nested . flat ( )
3232}
33- const distStats = await stat ( distDir )
33+ let distStats
34+
35+ try {
36+ distStats = await stat ( distDir )
37+ } catch ( error ) {
38+ if ( error && typeof error === 'object' && 'code' in error && error . code === 'ENOENT' ) {
39+ throw new Error ( 'dist directory is missing. Run build:prepare first.' , {
40+ cause : error ,
41+ } )
42+ }
43+
44+ throw error
45+ }
3446
3547if ( ! distStats . isDirectory ( ) ) {
3648 throw new Error ( 'dist directory is missing. Run build:prepare first.' )
Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ const run = script => {
1111 env,
1212 } )
1313
14+ if ( result . error ) {
15+ throw new Error ( `Failed to run npm script "${ script } ".` , {
16+ cause : result . error ,
17+ } )
18+ }
19+
1420 if ( result . status !== 0 ) {
1521 process . exit ( result . status ?? 1 )
1622 }
You can’t perform that action at this time.
0 commit comments