Build CSS using Vite
parent
e28a7c6f67
commit
8051d2d2e8
|
@ -22,7 +22,6 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<link rel="stylesheet" href="./src/shareon.css" />
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -42,9 +42,7 @@
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "pnpm run build:js && pnpm run build:css",
|
"build": "vite build",
|
||||||
"build:js": "vite build",
|
|
||||||
"build:css": "postcss src/shareon.css -o dist/shareon.min.css --map",
|
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"lint": "prettier --check . && eslint .",
|
"lint": "prettier --check . && eslint .",
|
||||||
"size": "size-limit",
|
"size": "size-limit",
|
||||||
|
@ -63,7 +61,6 @@
|
||||||
"postcss": "^8.4.19",
|
"postcss": "^8.4.19",
|
||||||
"postcss-banner": "^4.0.1",
|
"postcss-banner": "^4.0.1",
|
||||||
"postcss-calc": "^8.2.4",
|
"postcss-calc": "^8.2.4",
|
||||||
"postcss-cli": "^10.0.0",
|
|
||||||
"postcss-css-variables": "^0.18.0",
|
"postcss-css-variables": "^0.18.0",
|
||||||
"postcss-csso": "^6.0.1",
|
"postcss-csso": "^6.0.1",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import "./shareon.css";
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
/**
|
/**
|
||||||
* Map of social networks to their respective URL builders.
|
* Map of social networks to their respective URL builders.
|
||||||
|
|
|
@ -15,6 +15,12 @@ export default defineConfig({
|
||||||
},
|
},
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
|
// Workaround for a correct file name
|
||||||
|
// See: https://github.com/vitejs/vite/issues/4863
|
||||||
|
assetFileNames: (assetInfo) => {
|
||||||
|
if (assetInfo.name === "style.css") return "shareon.min.css";
|
||||||
|
return assetInfo.name;
|
||||||
|
},
|
||||||
banner: `/*! ${package_.name} v${package_.version} */`,
|
banner: `/*! ${package_.name} v${package_.version} */`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue