Skip to content

Commit

Permalink
🐳(front) build frontend in production mode
Browse files Browse the repository at this point in the history
The Dockerfile at root project is used to build the production image. We
should build the frontend application in production mode and compress
css.
  • Loading branch information
lunika committed Apr 5, 2019
1 parent 2afa223 commit 0b17e32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ COPY ./src /app/src/
WORKDIR /app/src/frontend

RUN yarn install --frozen-lockfile && \
yarn build && \
yarn sass
yarn build-production && \
yarn sass-production

# ---- back-end builder image ----
FROM base as back-builder
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
"main": "sandbox/manage.py",
"scripts": {
"build": "tsc --noEmit && webpack",
"build-production": "tsc --noEmit && webpack --mode=production",
"generate-l10n-template": "rip json2pot 'i18n/js/**/*.json' -o i18n/frontend.pot",
"generate-translations": "rip po2json './js/translations/*.po' -o './js/translations' -m './i18n/**/*.json'",
"lint": "tslint -c tslint.json 'js/**/*.ts?(x)'",
"prettier-write": "prettier --write 'js/**/*.+(ts|tsx|json|js|jsx)' '*.+(ts|tsx|json|js|jsx)' '**/*.+(css|scss)'",
"sass": "node-sass --include-path node_modules scss/_main.scss ../richie/static/richie/css/main.css",
"sass-production": "node-sass --include-path node_modules scss/_main.scss --output-style compressed ../richie/static/richie/css/main.css",
"test": "jest",
"watch-sass": "nodemon -e scss -x 'yarn sass'"
},
Expand Down

0 comments on commit 0b17e32

Please sign in to comment.