From 877e801519c423656cd6a0e002e3bff77274a8ae Mon Sep 17 00:00:00 2001 From: Vendeville Antoine Date: Tue, 26 Jul 2022 11:28:00 +0200 Subject: [PATCH] build(@vtmn/svelte): switch to postcss --- packages/sources/svelte/package.json | 4 +++- packages/sources/svelte/rollup.config.js | 8 ++++++-- yarn.lock | 25 +++++++++--------------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/packages/sources/svelte/package.json b/packages/sources/svelte/package.json index d71eaf963b..fd881e2273 100644 --- a/packages/sources/svelte/package.json +++ b/packages/sources/svelte/package.json @@ -76,8 +76,10 @@ "eslint-plugin-svelte3": "4.0.0", "jest": "^28.1.0", "jest-environment-jsdom": "^28.1.0", + "postcss": "^8.4.14", + "postcss-import": "^14.1.0", "rollup": "^2.73.0", - "rollup-plugin-css-only": "^3.1.0", + "rollup-plugin-postcss": "^4.0.2", "rollup-plugin-svelte": "^7.1.0", "svelte": "3.49.0", "svelte-jester": "^2.3.2", diff --git a/packages/sources/svelte/rollup.config.js b/packages/sources/svelte/rollup.config.js index dbe91be8d1..b2bee98b3b 100644 --- a/packages/sources/svelte/rollup.config.js +++ b/packages/sources/svelte/rollup.config.js @@ -1,7 +1,8 @@ import resolve from '@rollup/plugin-node-resolve'; -import css from 'rollup-plugin-css-only'; import svelte from 'rollup-plugin-svelte'; import sveltePreprocess from 'svelte-preprocess'; +import postcss from 'rollup-plugin-postcss'; +import postcssImport from 'postcss-import'; const preprocessOptions = require('./svelte.config').preprocessOptions; const src = { @@ -91,7 +92,10 @@ const svelteOptions = (component) => ({ svelte({ preprocess: sveltePreprocess(preprocessOptions), }), - css({ output: `${component}.css` }), + postcss({ + extract: `${component}.css`, + plugins: [postcssImport()], + }), resolve(), ], }); diff --git a/yarn.lock b/yarn.lock index 34ce757915..5b5e949920 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3304,14 +3304,6 @@ make-dir "^3.1.0" mime "^2.4.6" -"@rollup/pluginutils@4", "@rollup/pluginutils@^4.1.2", "@rollup/pluginutils@^4.2.1": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d" - integrity sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ== - dependencies: - estree-walker "^2.0.1" - picomatch "^2.2.2" - "@rollup/pluginutils@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" @@ -3321,6 +3313,14 @@ estree-walker "^1.0.1" picomatch "^2.2.2" +"@rollup/pluginutils@^4.1.2", "@rollup/pluginutils@^4.2.1": + version "4.2.1" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d" + integrity sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ== + dependencies: + estree-walker "^2.0.1" + picomatch "^2.2.2" + "@rushstack/eslint-patch@^1.1.0": version "1.1.4" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27" @@ -20159,19 +20159,12 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rollup-plugin-css-only@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-css-only/-/rollup-plugin-css-only-3.1.0.tgz#6a701cc5b051c6b3f0961e69b108a9a118e1b1df" - integrity sha512-TYMOE5uoD76vpj+RTkQLzC9cQtbnJNktHPB507FzRWBVaofg7KhIqq1kGbcVOadARSozWF883Ho9KpSPKH8gqA== - dependencies: - "@rollup/pluginutils" "4" - rollup-plugin-peer-deps-external@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/rollup-plugin-peer-deps-external/-/rollup-plugin-peer-deps-external-2.2.4.tgz#8a420bbfd6dccc30aeb68c9bf57011f2f109570d" integrity sha512-AWdukIM1+k5JDdAqV/Cxd+nejvno2FVLVeZ74NKggm3Q5s9cbbcOgUPGdbxPi4BXu7xGaZ8HG12F+thImYu/0g== -rollup-plugin-postcss@^4.0.0: +rollup-plugin-postcss@^4.0.0, rollup-plugin-postcss@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-postcss/-/rollup-plugin-postcss-4.0.2.tgz#15e9462f39475059b368ce0e49c800fa4b1f7050" integrity sha512-05EaY6zvZdmvPUDi3uCcAQoESDcYnv8ogJJQRp6V5kZ6J6P7uAVJlrTZcaaA20wTH527YTnKfkAoPxWI/jPp4w==