From be0b27a21aa2b1eb643523fa7e11184c93e395bc Mon Sep 17 00:00:00 2001 From: Prakshal Jain Date: Tue, 24 Sep 2024 14:19:09 -0700 Subject: [PATCH] Remove the minified version --- .../rollup-plugin/__tests__/index-test.js | 63 ++++++++++++++++++- packages/rollup-plugin/src/index.js | 1 - 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/packages/rollup-plugin/__tests__/index-test.js b/packages/rollup-plugin/__tests__/index-test.js index 7cda7c4f..2dff90b0 100644 --- a/packages/rollup-plugin/__tests__/index-test.js +++ b/packages/rollup-plugin/__tests__/index-test.js @@ -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'; diff --git a/packages/rollup-plugin/src/index.js b/packages/rollup-plugin/src/index.js index 660a1254..48aa7407 100644 --- a/packages/rollup-plugin/src/index.js +++ b/packages/rollup-plugin/src/index.js @@ -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