loopbackio / loopbackio/loopback-next
npm start build stuff and is too slow
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 5.1k
- Fork
- 1.1k
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 27
Mô tả
On a project made with the cli npm start launch the following command:
"start": "node -r source-map-support/register .",
This basically clean and build the full project and then start it in a dev mode.
This command can take forever to run. Azure App Service ping app and has a 230 timeout before they shutdown the container. On a small instance, the container will be shutdown before loopback has a chance to start. It's anyway a waste of ressource has Azure run build (in the build process, so no timeout) and then start (in startup script).
I belive npm start should run "start": "node ./dist/index.js", instead. A specific command for dev could be introduced such as "dev": "npm run build && node -r source-map-support/register .",.
Those are my current scripts:
"scripts": {
"build": "npm run clean & npm run copy-files && lb-tsc",
"build:watch": "lb-tsc --watch",
"pretest": "npm run build",
"migrate": "npm run build && node ./dist/migrate",
"openapi-spec": "npm run build && node ./dist/openapi-spec",
"dev": "npm run build && node -r source-map-support/register .",
"start": "node ./dist/index.js",
"clean": "lb-clean dist *.tsbuildinfo .eslintcache",
"copy-files": "mkdir -p dist && cp -r ./backend ./src/data ./dist"
},
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với các npm script của dự án được nêu trong issue và kiểm tra cách CLI khởi động từ đầu ra dist đã build. Hãy để npm start khởi chạy entry point đã build mà không build lại, giữ lại một lệnh development cho hành vi build-and-run, và xác minh rằng cả hai lệnh vẫn giữ đúng vai trò dự kiến.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- nodejs, typescript
- Lĩnh vực
- build-system, developer-experience
- Loại issue
- Tính năng
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100