chore: components config 수정

This commit is contained in:
2025-02-25 10:27:14 +09:00
parent b330ba6edd
commit 1a2e14eede
7 changed files with 20 additions and 22 deletions
@@ -1,7 +0,0 @@
declare const process: {
env: {
BASE_ASSETS_PATH?: string;
};
};
export const BASE_ASSETS_PATH = process.env.BASE_ASSETS_PATH;
@@ -17,15 +17,5 @@ const config: StorybookConfig = {
},
},
},
async viteFinal(config) {
config.define = {
...config.define,
"import.meta.env.BASE_ASSETS_PATH": JSON.stringify(
process.env.BASE_ASSETS_PATH,
),
};
return config;
},
};
export default config;
@@ -1,6 +1,6 @@
import { addons } from "@storybook/manager-api";
import { create } from "@storybook/theming";
import { BASE_ASSETS_PATH } from "./env";
import { BASE_ASSETS_PATH } from "../src/env";
const theme = create({
base: "light",
+3 -1
View File
@@ -10,7 +10,9 @@
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./base.css": "./dist/base.css",
"./diveicon.css": "./dist/diveicon.css"
},
"scripts": {
"build": "tsup",
+1 -1
View File
@@ -1 +1 @@
export const BASE_ASSETS_PATH = import.meta.env.BASE_ASSETS_PATH;
export const BASE_ASSETS_PATH = process.env.BASE_ASSETS_PATH;
+10
View File
@@ -8,9 +8,19 @@ export default defineConfig((options) => ({
clean: true,
dts: true,
format: ["esm"],
external: ["react", "react-dom"],
platform: "browser",
target: ["es2020", "chrome70", "edge18", "firefox70", "node18"],
tsconfig: path.resolve(__dirname, "tsconfig.build.json"),
sourcemap: !options.watch,
minify: !options.watch,
cssMinify: !options.watch,
cssModules: true,
postcss: true,
esbuildOptions(options) {
options.entryPoints = ["src/index.ts", "src/base.css", "src/diveicon.css"];
// options.alias = {
// "@/": path.resolve(__dirname, "src/"),
// };
},
}));
@@ -1,6 +1,9 @@
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
plugins: [tsconfigPaths()],
define: {
"process.env.BASE_ASSETS_PATH": JSON.stringify(
process.env.BASE_ASSETS_PATH,
),
},
});