Skip to content

Commit

Permalink
Config: Refactor SCSS build process in frontend (#923)
Browse files Browse the repository at this point in the history
* config: Refactor SCSS build process in frontend

* config: Make storybook import the sass file directly as well
  • Loading branch information
drikusroor authored Apr 10, 2024
1 parent 1c49bc3 commit faf76a9
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
- name: Install dependencies
run: yarn
working-directory: ./frontend
- name: Run SCSS
run: yarn scss
working-directory: ./frontend
- name: Build Storybook
run: yarn storybook:build
working-directory: ./frontend
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ services:
- VITE_STRICT=${FRONTEND_STRICT}
ports:
- 3000:3000
command: sh -c "yarn scss && yarn start"
command: yarn start
volumes:
db_data:
db_backup:
2 changes: 1 addition & 1 deletion frontend/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "../public/vendor/bootstrap/bootstrap.min.css";
import "../src/index.css";
import "../src/index.scss";
import { initAudioListener } from "../src/util/audio";
import { initWebAudioListener } from "../src/util/webAudio";

Expand Down
1 change: 0 additions & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ COPY . /client/
COPY .env /client/

RUN yarn
RUN yarn scss
RUN yarn build

# Runner image that serves the built app using nginx
Expand Down
4 changes: 1 addition & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@
},
"scripts": {
"start": "vite --host",
"build": "sass src/index.scss src/index.css && vite build",
"build": "vite build",
"preview": "vite preview",
"test": "vitest",
"test:ci": "vitest --watch=false --coverage",
"generate-badge": "coverage-badges -s coverage/coverage-summary.json -o coverage-frontend-badge-new.svg --label 'Frontend Code Coverage'",
"scss": "sass src/index.scss src/index.css",
"scss:watch": "sass src/index.scss src/index.css; sass --watch src/index.scss src/index.css",
"storybook": "storybook dev -p 6006",
"storybook:build": "storybook build",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "./index.css";
import React, { StrictMode } from "react";
import "./index.scss";
import { StrictMode } from "react";
import { createRoot } from 'react-dom/client';
import App from "./components/App/App";
import { initSentry } from "./config/sentry";
Expand Down

0 comments on commit faf76a9

Please sign in to comment.