Skip to content

Commit 575ae52

Browse files
committed
fix: build webpack and docker.ssr
1 parent d96bd4d commit 575ae52

File tree

7 files changed

+26
-7560
lines changed

7 files changed

+26
-7560
lines changed

.dockerignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
dist
2+
tmp
3+
out-tsc
4+
dist-server
5+
static
6+
server.js
7+
prerender.js
8+
node_modules
9+
npm-debug.log
10+
Dockerfile*
11+
docker-compose*
12+
.dockerignore
13+
.git
14+
.gitignore
15+
README.md
16+
LICENSE
17+
.vscode

Dockerfile.ssr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM node:8-alpine as buildContainer
2-
3-
COPY . /app
42
WORKDIR /app
3+
COPY ./package.json ./package-lock.json /app/
54
RUN npm install
5+
COPY . /app
66
RUN npm run build:universal
77
RUN npm run generate:prerender
88

package-lock.json

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"cookie-parser": "1.4.3",
4646
"core-js": "2.5.7",
4747
"ngx-cookie-service": "1.0.10",
48+
"reflect-metadata": "0.1.12",
4849
"rxjs": "6.2.2",
4950
"rxjs-tslint": "0.1.5",
5051
"zone.js": "0.8.26"

server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import 'zone.js/dist/zone-node';
2+
import 'reflect-metadata';
3+
14
const domino = require('domino');
25
const fs = require('fs');
36
const path = require('path');

webpack.config.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
const path = require('path');
22
const webpack = require('webpack');
3-
const nodeExternals = require('webpack-node-externals');
3+
44
/**
55
* This is a server config which should be merged on top of common config
66
*/
77
module.exports = {
88
mode: 'development',
9-
externals: [
10-
nodeExternals({ whitelist: [
11-
/\.(?!(?:jsx?|json)$).{1,5}$/i,
12-
/ngx-cookie-service/
13-
] }),
14-
/main\..*\.js/
15-
],
16-
9+
externals: [/(node_modules|main\..*\.js)/],
1710
entry: {
1811
// This is our Express server for Dynamic universal
1912
server: './server.ts',

0 commit comments

Comments
 (0)