Skip to content

Commit 473d29c

Browse files
authored
fix(eagle): add version prefix to linaria classes (#1291)
1 parent 075b92d commit 473d29c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/eagle/rollup.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import mergeScss from "./tools/merge-linaria-scss";
1818
import antdLessPlugin from "./tools/rollup-plugin-antd-less";
1919

2020
const projectRootDir = path.resolve(__dirname);
21+
const eagleVersionSlug = JSON.parse(
22+
fs.readFileSync(path.join(__dirname, "package.json"), "utf-8"),
23+
).version.replace(/[^a-zA-Z0-9]+/g, "_");
2124

2225
const config = defineConfig([
2326
// bundle components & styles
@@ -57,7 +60,7 @@ const config = defineConfig([
5760
linaria.default({
5861
sourceMap: false,
5962
preprocessor: "none",
60-
classNameSlug: (hash, title) => `E_${hash}`,
63+
classNameSlug: (hash) => `E_${eagleVersionSlug}_${hash}`,
6164
}),
6265
mergeScss({
6366
include: ["src/**/*.scss", "src/**/*.sass", "src/**/*.css"],

0 commit comments

Comments
 (0)