mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-20 15:54:22 +01:00
27 lines
662 B
JavaScript
27 lines
662 B
JavaScript
import fs from "fs";
|
|
import withSolid from "rollup-preset-solid";
|
|
import image from '@rollup/plugin-image';
|
|
import css from "rollup-plugin-css-only";
|
|
|
|
const stripCSSImport = () => {
|
|
return {
|
|
name: "strip-css-import",
|
|
generateBundle() {
|
|
const path = fs.realpathSync("./dist/source/index.jsx");
|
|
const data = fs.readFileSync(path, { encoding: "utf8" });
|
|
const transformed = data.replace(/^import ".\/index.css";/, "");
|
|
fs.writeFileSync(path, transformed);
|
|
},
|
|
};
|
|
};
|
|
|
|
export default withSolid({
|
|
input: "src/index.tsx",
|
|
cache: false,
|
|
plugins: [
|
|
image(),
|
|
css({ output: "style.css" }),
|
|
stripCSSImport()
|
|
],
|
|
});
|