Skip to content

Commit

Permalink
Remove the minified version
Browse files Browse the repository at this point in the history
  • Loading branch information
Prakshal-Jain committed Sep 24, 2024
1 parent 8e69852 commit be0b27a
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 4 deletions.
63 changes: 60 additions & 3 deletions packages/rollup-plugin/__tests__/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,66 @@ describe('rollup-plugin-stylex', () => {
it('extracts CSS and removes stylex.inject calls', async () => {
const { css, js } = await runStylex({ fileName: 'stylex.css' });

expect(css).toMatchInlineSnapshot(
`"@layer priority1{@keyframes xgnty7z-B{0%{opacity:.25}to{opacity:1}}}@layer priority2{.x1oz5o6v:hover{background:red}}@layer priority3{.xeuoslp{animation-name:xgnty7z-B}.x1lliihq{display:block}.x78zum5{display:flex}.xt0psk2{display:inline}.x1hm9lzh{margin-inline-start:10px}}@layer priority4{.x1egiwwb{height:500px}.xlrshdv{margin-top:99px}.xh8yej3{width:100%}.x3hqpx7{width:50%}}"`,
);
expect(css).toMatchInlineSnapshot(`
"@layer priority1 {
@keyframes xgnty7z-B {
0% {
opacity: .25;
}
100% {
opacity: 1;
}
}
}
@layer priority2 {
.x1oz5o6v:hover {
background: red;
}
}
@layer priority3 {
.xeuoslp {
animation-name: xgnty7z-B;
}
.x1lliihq {
display: block;
}
.x78zum5 {
display: flex;
}
.xt0psk2 {
display: inline;
}
.x1hm9lzh {
margin-inline-start: 10px;
}
}
@layer priority4 {
.x1egiwwb {
height: 500px;
}
.xlrshdv {
margin-top: 99px;
}
.xh8yej3 {
width: 100%;
}
.x3hqpx7 {
width: 50%;
}
}
"
`);

expect(js).toMatchInlineSnapshot(`
"import stylex from 'stylex';
Expand Down
1 change: 0 additions & 1 deletion packages/rollup-plugin/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export default function stylexPlugin({
const { code } = transform({
filename: 'stylex.css',
code: Buffer.from(collectedCSS),
minify: true,
});

// Convert the Buffer back to a string
Expand Down

0 comments on commit be0b27a

Please sign in to comment.