Update README.md
This commit is contained in:
@@ -67,10 +67,10 @@ npx create-next-app@latest ./apps/as --typescript --eslint --tailwind --app
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
// 기타 설정 ...
|
// 기타 설정 ...
|
||||||
|
"baseUrl": "./src",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@common/components/*": ["../../../packages/common/components/src/*"],
|
"@common/components": ["../../../packages/common/components/dist/"],
|
||||||
"@common/components": ["../../../packages/common/components/src"],
|
"@common/config": ["../../../packages/common/config/dist/"],
|
||||||
"@common/network/*": ["../../../packages/common/network/*"],
|
|
||||||
"@common/network": ["../../../packages/common/network/"]
|
"@common/network": ["../../../packages/common/network/"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,51 +95,34 @@ export default {
|
|||||||
### 5. next.config.ts 수정
|
### 5. next.config.ts 수정
|
||||||
```json
|
```json
|
||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from "next";
|
||||||
import webpack from "webpack";
|
|
||||||
|
|
||||||
const serverApiUrl =
|
const subDomain =
|
||||||
process.env.NEXT_PUBLIC_SERVER_API_URL || "http://localhost:3000";
|
process.env.NEXT_PUBLIC_SUB_DOMAIN || "http://localhost:13000";
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
webpack: (config) => {
|
|
||||||
config.plugins.push(
|
|
||||||
// common/components의 vite 환경 변수를 next 환경 변수로 정의
|
|
||||||
new webpack.DefinePlugin({
|
|
||||||
"import.meta.env.VITE_PORT": JSON.stringify(
|
|
||||||
process.env.NEXT_PUBLIC_PORT,
|
|
||||||
),
|
|
||||||
"import.meta.env.VITE_PROXY_HOST": JSON.stringify(
|
|
||||||
process.env.NEXT_PUBLIC_PROXY_HOST,
|
|
||||||
),
|
|
||||||
"import.meta.env.VITE_SERVER_API_URL": JSON.stringify(
|
|
||||||
process.env.NEXT_PUBLIC_SERVER_API_URL,
|
|
||||||
),
|
|
||||||
"import.meta.env.VITE_SITE_ID": JSON.stringify(process.env.SITE_ID),
|
|
||||||
"import.meta.env.VITE_CLAIM_NAME": JSON.stringify(
|
|
||||||
process.env.NEXT_PUBLIC_CLAIM_NAME,
|
|
||||||
),
|
|
||||||
"import.meta.env.VITE_ACCESS_TOKEN": JSON.stringify(
|
|
||||||
process.env.NEXT_PUBLIC_ACCESS_TOKEN,
|
|
||||||
),
|
|
||||||
"import.meta.env.VITE_REFRESH_TOKEN": JSON.stringify(
|
|
||||||
process.env.NEXT_PUBLIC_REFRESH_TOKEN,
|
|
||||||
),
|
|
||||||
"import.meta.env.VITE_AUTH_USER_ID": JSON.stringify(
|
|
||||||
process.env.NEXT_PUBLIC_AUTH_USER_ID,
|
|
||||||
),
|
|
||||||
"process.env.SITE_ID": JSON.stringify(process.env.NEXT_PUBLIC_SITE_ID),
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
return config;
|
|
||||||
},
|
|
||||||
async rewrites() {
|
async rewrites() {
|
||||||
return [
|
return {
|
||||||
{
|
beforeFiles: [
|
||||||
source: "/server/:path*",
|
{
|
||||||
destination: `${serverApiUrl}/:path*`,
|
source: "/_next/static/:path*",
|
||||||
},
|
destination: `${subDomain}/_next/static/:path*`,
|
||||||
];
|
has: [
|
||||||
|
{
|
||||||
|
type: "header",
|
||||||
|
key: "referer",
|
||||||
|
value: "(.*)/pst(.*)",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
afterFiles: [
|
||||||
|
{
|
||||||
|
source: "/pst/:path*",
|
||||||
|
destination: `${subDomain}/pst/:path*`,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
fallback: [],
|
||||||
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -151,7 +134,7 @@ export default nextConfig;
|
|||||||
```css
|
```css
|
||||||
@import "@common/assets/styles/base.css";
|
@import "@common/assets/styles/base.css";
|
||||||
@import "@common/assets/styles/diveicon.css";
|
@import "@common/assets/styles/diveicon.css";
|
||||||
@import "@common/assets/styles/components.css";
|
@import "@common/components/index.css";
|
||||||
|
|
||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
|
|||||||
Reference in New Issue
Block a user