Linux サーバーからアプリケーションをデプロイしようとしています。
私のlite-serverコマンドがファイルを提供していないという事実を除いて、すべてが正常に機能します。サーバーにアクセスすると、serverUrl:3000
スローが発生します
「サイトの応答に時間がかかりすぎます」
package.json
(私が実行するnpm start
)からの私のスクリプト
"scripts": {
"build": "tsc -p src/",
"serve": "lite-server -c=bs-config.json",
"prestart": "npm run build",
"start": "concurrently \"npm run build:watch\" \"npm run serve\"",
"pretest": "npm run build",
"test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"",
"test-once": "karma start karma.conf.js --test-once",
"pretest:once": "npm run build",
"build:watch": "tsc -p src/ -w",
"build:upgrade": "tsc",
"serve:upgrade": "http-server",
"build:aot": "ngc -p tsconfig-aot.json && rollup -c rollup-config.js",
"serve:aot": "lite-server -c bs-config.aot.json",
"build:babel": "babel src -d src --extensions \".es6\" --source-maps",
"copy-dist-files": "node ./copy-dist-files.js",
"i18n": "ng-xi18n",
"lint": "tslint ./src/**/*.ts -t verbose"
},
私のbs-config.json
。"open" : false
lite-server が望ましくないブラウザを開こうとしたため、 を追加する必要がありました。
{
"server": {
"baseDir": "src",
"routes": {
"/node_modules": "node_modules"
}
}, "open" : false
}
このコマンドの出力は次のとおりです。
> angular-io-example@1.0.0 prestart /home/deploy/home/deploy/frontend
> npm run build
> angular-io-example@1.0.0 build /home/deploy/home/deploy/frontend
> tsc -p src/
> angular-io-example@1.0.0 start /home/deploy/home/deploy/frontend
> concurrently "npm run build:watch" "npm run serve"
[0]
[0] > angular-io-example@1.0.0 build:watch /home/deploy/home/deploy/frontend
[0] > tsc -p src/ -w
[0]
[1]
[1] > angular-io-example@1.0.0 serve /home/deploy/home/deploy/frontend
[1] > lite-server -c=bs-config.json
[1]
[1] ** browser-sync config **
[1] { injectChanges: false,
[1] files: [ './**/*.{html,htm,css,js}' ],
[1] watchOptions: { ignored: 'node_modules' },
[1] server:
[1] { baseDir: 'src',
[1] middleware: [ [Function], [Function] ],
[1] routes: { '/node_modules': 'node_modules' } },
[1] open: false }
[1] [BS] Access URLs:
[1] ----------------------------------------
[1] Local: http://localhost:3000
[1] External: http://serverurl:3000
[1] ----------------------------------------
[1] UI: http://localhost:3001
[1] UI External: http://serverurl:3001
[1] ----------------------------------------
[1] [BS] Serving files from: src
[1] [BS] Watching files...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[0] 9:42:13 AM - Compilation complete. Watching for file changes.
これを Windows マシンで実行するとすべて正常に動作しますが、ファイルは実際にはコンソールにも表示されています。何か案は?