Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(travis): fix heroku stage #4820

Merged
merged 3 commits into from
Nov 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,17 @@ jobs:
project: ./gh-pages/
domain: ngx-bootstrap-latest.surge.sh
on: development
# todo: Illya please fix
# - stage: deploy
# script: npm run build:dynamic
# before_deploy:
# - cd ./demo/dist
# deploy:
# provider: heroku
# api_key: $HEROKU_API_KEY
# skip_cleanup: true
# app: ngx-universal
# on: development
# deploy to ngx-universal.herokuapp.com/
- stage: deploy
script: npm run build:dynamic
before_deploy:
- cd ./demo/dist
deploy:
provider: heroku
api_key: $HEROKU_API_KEY
skip_cleanup: true
app: ngx-universal
on: development

# publish to gh pages and npm
- stage: publish
Expand Down
4 changes: 2 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "demo/dist/server",
"main": "main.server.ts",
"tsConfig": "tsconfig.server.json"
"main": "demo/src/main.server.ts",
"tsConfig": "demo/src/tsconfig.server.json"
}
}
}
Expand Down
209 changes: 209 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"cy:open": "cypress open",
"cy:run": "cypress run --config video=false",
"view-stats": "webpack-bundle-analyzer demo/dist/stats.json",
"build:dynamic": "run-s build link build:client-and-server-bundles webpack:server configure-heroku",
"serve:dynamic": "node demo/dist/server.js",
"build:client-and-server-bundles": "ng build -bh / --prod --env=server && ng build -bh / --prod --env=server --app 1 --output-hashing=false",
"build:dynamic": "run-s build build:client-and-server-bundles webpack:server configure-heroku",
"serve:dynamic": "node demo/dist/server",
"build:client-and-server-bundles": "ng build --prod && ng run ngx-bootstrap:server",
"webpack:server": "webpack --config ./scripts/universal/webpack.server.config.js --progress --colors",
"configure-heroku": "node scripts/universal/configure-heroku.js"
},
Expand Down Expand Up @@ -135,9 +135,9 @@
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-edge-launcher": "0.4.2",
"karma-firefox-launcher": "1.1.0",
"karma-ie-launcher": "1.0.0",
"karma-jasmine": "1.1.2",
"karma-jasmine-html-reporter": "1.1.0",
"karma-ie-launcher": "1.0.0",
"karma-remap-istanbul": "0.6.0",
"karma-safari-launcher": "1.0.0",
"karma-sauce-launcher": "1.2.0",
Expand Down Expand Up @@ -166,6 +166,7 @@
"wait-on": "2.1.0",
"wallaby-webpack": "3.9.7",
"webpack-bundle-analyzer": "2.11.3",
"webpack-cli": "3.1.2",
"zone.js": "0.8.26"
}
}
2 changes: 1 addition & 1 deletion scripts/universal/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { renderModuleFactory } from '@angular/platform-server';
import { ROUTES } from './static.paths';

// * NOTE :: leave this as require() since this file is built Dynamically from webpack
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('../../demo/dist/server/main.bundle');
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('../../demo/dist/server/main');

const BROWSER_FOLDER = join(process.cwd(), 'browser');

Expand Down
2 changes: 1 addition & 1 deletion scripts/universal/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const DIST_FOLDER = join(process.cwd(), process.env.DYNO ? './' : 'demo/dist');
const template = readFileSync(join(DIST_FOLDER, 'browser', 'index.html')).toString();

// * NOTE :: leave this as require() since this file is built Dynamically from webpack
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('../../demo/dist/server/main.bundle');
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('../../demo/dist/server/main');

const { provideModuleMap } = require('@nguniversal/module-map-ngfactory-loader');

Expand Down
4 changes: 3 additions & 1 deletion scripts/universal/webpack.server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const path = require('path');
const webpack = require('webpack');

module.exports = {
// https://github.com/angular/angular-cli/issues/10635
mode: 'development',
entry: { server: './scripts/universal/server.ts', prerender: './scripts/universal/prerender.ts' },
resolve: { extensions: ['.ts', '.js'] },
target: 'node',
Expand Down Expand Up @@ -29,4 +31,4 @@ module.exports = {
path.join(__dirname, 'src'),
)
]
}
};