以下任何腳本都可以透過在專案的根目錄中輸入 npm run <腳本名稱>
來執行。
開發中
腳本名稱 | 說明 |
---|
dev | 在連接埠 3200 上產生一個熱重新載入的開發伺服器。 |
deps-check | 產生 Swagger UI 相依性的尺寸和授權報告。 |
lint | 報告 ESLint 樣式錯誤和警告。 |
lint-errors | 報告 ESLint 樣式錯誤,不包含警告。 |
lint-fix | 嘗試自動修正樣式錯誤。 |
watch | 當原始碼變更時,重建 /dist 中的核心檔案。適用於與 Swagger Editor 的 npm link 。 |
建置
腳本名稱 | 說明 |
---|
build | 建置一組新的 JS 和 CSS 資產,並將其輸出到 /dist 。 |
build-bundle | 僅建置 swagger-ui-bundle.js (commonJS)。 |
build-core | 僅建置 swagger-ui.(js|css) (commonJS)。 |
build-standalone | 僅建置 swagger-ui-standalone-preset.js (commonJS)。 |
build-stylesheets | 僅建置 swagger-ui.css 。 |
build:es:bundle | 僅建置 swagger-ui-es-bundle.js (es2015)。 |
build:es:bundle:core | 僅建置 swagger-ui-es-bundle-core.js (es2015)。 |
測試
腳本名稱 | 說明 |
---|
test | 在 Node 中執行單元測試,執行 Cypress 端對端測試,並在僅限錯誤模式中執行 ESLint。 |
test:unit | 在 Node 中執行 Jest 單元測試。 |
e2e | 執行端對端測試 (需要 JDK 和 Selenium)。 |
e2e-cypress | 使用 Cypress 執行端對端瀏覽器測試。 |
dev-e2e-cypress | 開發模式,開啟 Cypress 執行器並手動選擇要執行的測試。 |
lint | 執行 ESLint 測試 |
test:artifact | 在 Jest 中執行套件成品測試清單 |
test:artifact:umd:bundle | 執行確認 swagger-ui-bundle 匯出為函數的單元測試 |
test:artifact:es:bundle | 執行確認 swagger-ui-es-bundle 匯出為函數的單元測試 |
test:artifact:es:bundle:core | 執行確認 swagger-ui-es-bundle-core 匯出為函數的單元測試 |