Skip to content

Commit

Permalink
reactor!: rename style.css -> styles.css
Browse files Browse the repository at this point in the history
  • Loading branch information
mfal committed Jan 25, 2024
1 parent 02ea4f5 commit 7029f93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"./TextArea": "./dist/TextArea.js",
"./TextField": "./dist/TextField.js",
"./Tooltip": "./dist/Tooltip.js",
"./style": "./dist/style.css",
"./style/init": "./dist/index.js"
"./styles": "./dist/styles.css"
},
"files": [
"dist"
Expand Down
9 changes: 8 additions & 1 deletion packages/components/vite.build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default defineConfig(
entry: {
Avatar: "./src/components/Avatar/index.ts",
Badge: "./src/components/Badge/index.ts",
Breadcrumb: "./src/components/Breadcrumb/index.ts",
Button: "./src/components/Button/index.ts",
Checkbox: "./src/components/Checkbox/index.ts",
Content: "./src/components/Content/index.ts",
Expand Down Expand Up @@ -46,6 +45,14 @@ export default defineConfig(
formats: ["es"],
},
rollupOptions: {
output: {
assetFileNames: (assetInfo: { name: string }) => {
if (assetInfo.name === "style.css") {
return "styles.css";
}
return assetInfo.name;
},
},
external: [
"react",
"react-dom",
Expand Down
4 changes: 2 additions & 2 deletions packages/stylesheet/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import * as path from "path";
import { createRequire } from "module";

const stylesheetPathname = createRequire(import.meta.url).resolve(
"@mittwald/flow-next-components/style",
"@mittwald/flow-next-components/styles",
);

const thisDirname = path.dirname(url.fileURLToPath(import.meta.url));

const targetPathname = path.join(thisDirname, "dist/style.css");
const targetPathname = path.join(thisDirname, "dist/styles.css");

if (!fs.existsSync(path.dirname(targetPathname))) {
fs.mkdirSync(path.dirname(targetPathname));
Expand Down

0 comments on commit 7029f93

Please sign in to comment.