Skip to content

Commit ac93515

Browse files
chore: re-configure rollup-plugin-svelte
... after breaking update. Re-aligned the configuration as demonstrated [here](https://github.com/sveltejs/template/blob/5b1135c286f7a649daa99825a077586655051649/rollup.config.js#L48). The breaking changes were: * [removing CSS extraction](sveltejs/rollup-plugin-svelte#147) * [nesting compiler options in key](sveltejs/rollup-plugin-svelte#145)
1 parent 624ee88 commit ac93515

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"prettier-plugin-svelte": "^2.1.4",
2929
"rollup": "^2.38.5",
3030
"rollup-plugin-commonjs": "^10.1.0",
31+
"rollup-plugin-css-only": "^3.1.0",
3132
"rollup-plugin-livereload": "^2.0.0",
3233
"rollup-plugin-md": "^1.0.1",
3334
"rollup-plugin-node-resolve": "^5.2.0",

rollup.config.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import svelte from 'rollup-plugin-svelte'
22
import resolve from 'rollup-plugin-node-resolve'
33
import commonjs from 'rollup-plugin-commonjs'
44
import md from 'rollup-plugin-md'
5+
import css from 'rollup-plugin-css-only'
56
import livereload from 'rollup-plugin-livereload'
67
import { terser } from 'rollup-plugin-terser'
78
import visualizer from 'rollup-plugin-visualizer'
@@ -19,14 +20,14 @@ export default {
1920
},
2021
plugins: [
2122
svelte({
22-
// enable run-time checks when not in production
23-
dev: !production,
24-
// we'll extract any component CSS out into
25-
// a separate file — better for performance
26-
css: (css) => {
27-
css.write('bundle.css')
23+
compilerOptions: {
24+
// enable run-time checks when not in production
25+
dev: !production,
2826
},
2927
}),
28+
// we'll extract any component CSS out into
29+
// a separate file - better for performance
30+
css({ output: 'bundle.css' }),
3031

3132
// If you have external dependencies installed from
3233
// npm, you'll most likely need these plugins. In

yarn.lock

+21-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@
4444
"@nodelib/fs.scandir" "2.1.3"
4545
fastq "^1.6.0"
4646

47+
"@rollup/pluginutils@4":
48+
version "4.1.0"
49+
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.0.tgz#0dcc61c780e39257554feb7f77207dceca13c838"
50+
integrity sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==
51+
dependencies:
52+
estree-walker "^2.0.1"
53+
picomatch "^2.2.2"
54+
4755
"@types/color-name@^1.1.1":
4856
version "1.1.1"
4957
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
@@ -527,6 +535,11 @@ estree-walker@^0.6.1:
527535
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362"
528536
integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==
529537

538+
estree-walker@^2.0.1:
539+
version "2.0.2"
540+
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
541+
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
542+
530543
execa@^0.7.0:
531544
version "0.7.0"
532545
resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777"
@@ -1162,7 +1175,7 @@ path-type@^4.0.0:
11621175
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
11631176
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
11641177

1165-
picomatch@^2.0.4, picomatch@^2.0.7, picomatch@^2.2.1:
1178+
picomatch@^2.0.4, picomatch@^2.0.7, picomatch@^2.2.1, picomatch@^2.2.2:
11661179
version "2.2.2"
11671180
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
11681181
integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
@@ -1309,6 +1322,13 @@ rollup-plugin-commonjs@^10.1.0:
13091322
resolve "^1.11.0"
13101323
rollup-pluginutils "^2.8.1"
13111324

1325+
rollup-plugin-css-only@^3.1.0:
1326+
version "3.1.0"
1327+
resolved "https://registry.yarnpkg.com/rollup-plugin-css-only/-/rollup-plugin-css-only-3.1.0.tgz#6a701cc5b051c6b3f0961e69b108a9a118e1b1df"
1328+
integrity sha512-TYMOE5uoD76vpj+RTkQLzC9cQtbnJNktHPB507FzRWBVaofg7KhIqq1kGbcVOadARSozWF883Ho9KpSPKH8gqA==
1329+
dependencies:
1330+
"@rollup/pluginutils" "4"
1331+
13121332
rollup-plugin-livereload@^2.0.0:
13131333
version "2.0.0"
13141334
resolved "https://registry.yarnpkg.com/rollup-plugin-livereload/-/rollup-plugin-livereload-2.0.0.tgz#d3928d74e8cf2ae4286c5dd46b770fd3f3b82313"

0 commit comments

Comments
 (0)