diff --git a/package.json b/package.json index d5d07d2..d0279ba 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "lint": "run-s lint:*", "lint:code": "eslint --fix . --ext .js,.jsx,.ts,.tsx", "lint:type": "tsc", - "lint:style": "stylelint --fix \"**/*.{css,ts,tsx}\"", + "lint:style": "stylelint --fix \"**/*.{css,scss,sass,ts,tsx}\"", "lint:format": "prettier -w . -u --loglevel silent", "test": "cross-env NODE_ENV=test jest --config ./jest/config.js", "test:watch": "yarn test --watch", @@ -93,7 +93,6 @@ "lodash": "^4.17.21", "morgan": "^1.10.0", "normalize.css": "^8.0.1", - "os": "^0.1.2", "react": "^17.0.2", "react-dom": "^17.0.2", "react-helmet": "^6.1.0", diff --git a/src/app/index.tsx b/src/app/index.tsx index 958558e..d93cc71 100755 --- a/src/app/index.tsx +++ b/src/app/index.tsx @@ -7,8 +7,8 @@ import logo from "../static/logo.svg" import config from "../config" // Import your global styles here import "normalize.css/normalize.css" -import styles from "./styles.module.scss" import "react-toastify/dist/ReactToastify.css" +import styles from "./styles.module.scss" interface Route { route: { routes: RouteConfig[] } diff --git a/src/config/prod.ts b/src/config/prod.ts index 45e5f49..5b882dd 100755 --- a/src/config/prod.ts +++ b/src/config/prod.ts @@ -1,9 +1,11 @@ -import os from "os" - -const hostname = os.hostname() +const PORT = 4000 +const HOST_LOCALLY = true export default { - PORT: 4000, - HOST: hostname === "ns3075300" ? "fo.parisestludique.fr" : "localhost", - API_URL: hostname === "ns3075300" ? "http://fo.parisestludique.fr" : "http://localhost:4000", + PORT, + HOST: HOST_LOCALLY ? "localhost" : "fo.parisestludique.fr", + API_URL: + __SERVER__ || HOST_LOCALLY + ? `http://localhost:${PORT}` + : `http://fo.parisestludique.fr:${PORT}`, } diff --git a/webpack/base.config.ts b/webpack/base.config.ts index 1e56147..d584d50 100644 --- a/webpack/base.config.ts +++ b/webpack/base.config.ts @@ -16,7 +16,7 @@ const getStyleLoaders = (isWeb: boolean, isSass?: boolean) => { importLoaders: isSass ? 2 : 1, modules: { auto: true, - localIdentName: isDev ? "[path][name]__[local]" : "[hash:base64]", + localIdentName: "[path][name]__[local]", // Don't use hash:base64, a bug makes it generate different hashes in the .js and the .css files exportOnlyLocals: !isWeb, }, }, diff --git a/yarn.lock b/yarn.lock index fc50f7d..2a2aa14 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7857,11 +7857,6 @@ os-filter-obj@^2.0.0: dependencies: arch "^2.1.0" -os@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/os/-/os-0.1.2.tgz#f29a50c62908516ba42652de42f7038600cadbc2" - integrity sha512-ZoXJkvAnljwvc56MbvhtKVWmSkzV712k42Is2mA0+0KTSRakq5XXuXpjZjgAt9ctzl51ojhQWakQQpmOvXWfjQ== - p-cancelable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa"