diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 939ba3a..30d5a76 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -7,7 +7,7 @@ RUN apt update && export DEBIAN_FRONTEND=noninteractive \ RUN git lfs install -RUN npm i -g yarn concurrently +RUN npm i && npm run init ENV ZSH_CUSTOM /root/.oh-my-zsh/ RUN git clone https://github.com/reobin/typewritten.git $ZSH_CUSTOM/themes/typewritten diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d3cddad..17aa5ee 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -16,7 +16,7 @@ jobs: lfs: true - name: Build project run: | - yarn && yarn run build + npm i && npm run init && npm run build - name: Deploy frontend uses: w9jds/firebase-action@master with: diff --git a/backend/package.json b/backend/package.json index 14de072..a70bc11 100644 --- a/backend/package.json +++ b/backend/package.json @@ -6,7 +6,7 @@ "author": "AndrĂ¡s Schmelczer (https://schmelczer.dev/)", "main": "dist/main.js", "bin": { - "declared-server": "./dist/main.js" + "declared-server": "dist/main.js" }, "scripts": { "build": "npx webpack --mode production", @@ -44,6 +44,7 @@ "prettier": "^2.0.5", "raw-loader": "^4.0.1", "resolve-url-loader": "^3.1.1", + "shared": "file:../shared", "terser-webpack-plugin": "^2.3.5", "ts-config-webpack-plugin": "^2.0.0", "ts-loader": "^8.0.3", diff --git a/frontend/package.json b/frontend/package.json index d4434c2..595ff56 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -38,8 +38,11 @@ "resolve-url-loader": "^3.1.1", "scss-config-webpack-plugin": "^2.0.0", "sdf-2d": "^0.6.0", + "shared": "file:../shared", "socket.io-client": "^2.3.1", "source-map-loader": "^1.1.1", + "style-ext-html-webpack-plugin": "^4.1.2", + "svg-url-loader": "^6.0.0", "terser-webpack-plugin": "^4.2.2", "ts-config-webpack-plugin": "^2.0.0", "typescript": "^4.0.3", diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index dd5536f..2c61699 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -4,6 +4,8 @@ const ScssConfigWebpackPlugin = require('scss-config-webpack-plugin'); const TsConfigWebpackPlugin = require('ts-config-webpack-plugin'); const HtmlWebpackInlineSVGPlugin = require('html-webpack-inline-svg-plugin'); const TerserJSPlugin = require('terser-webpack-plugin'); +//const FaviconsWebpackPlugin = require('favicons-webpack-plugin'); +//const StyleExtHtmlWebpackPlugin = require('style-ext-html-webpack-plugin'); module.exports = { devServer: { @@ -28,6 +30,8 @@ module.exports = { }, ], }), + //new StyleExtHtmlWebpackPlugin('main.css'), + //new FaviconsWebpackPlugin('static/logo.svg'), // SCSS Configuration for .css .module.css and .scss .module.scss files // see https://github.com/namics/webpack-config-plugins/tree/master/packages/scss-config-webpack-plugin/config new ScssConfigWebpackPlugin(), @@ -54,7 +58,14 @@ module.exports = { use: ['source-map-loader'], }, { - test: /\.(svg|png)$/, + test: /\.svg/, + use: { + loader: 'svg-url-loader', + options: {}, + }, + }, + { + test: /\.(png)$/, use: { loader: 'file-loader', }, diff --git a/package.json b/package.json index 4c3b417..deaa1cd 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,6 @@ { "name": "root", "private": true, - "workspaces": { - "packages": [ - "frontend", - "shared", - "backend" - ] - }, "devDependencies": { "concurrently": "^5.3.0" }, @@ -15,6 +8,7 @@ "build": "cd shared && npm run build && cd ../frontend && npm run build && cd ../backend && npm run build", "lint": "eslint './**/src/**/*.{js,ts,json}' --fix", "frontend": "yarn workspace decla.red-frontend start", + "init": "cd shared && npm install && cd ../frontend && npm install && cd ../backend && npm install", "shared": "yarn workspace shared start", "backend": "yarn workspace declared-server start", "start": "concurrently --kill-others-on-fail \"cd shared && npm start\" \"cd backend && npm start\" \"cd frontend && npm start\""