Skip to content

Instantly share code, notes, and snippets.

@wlach
Created January 7, 2021 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wlach/647157b16ad6ed7b9f5a4a32500985bf to your computer and use it in GitHub Desktop.
Save wlach/647157b16ad6ed7b9f5a4a32500985bf to your computer and use it in GitHub Desktop.
diff --git a/package-lock.json b/package-lock.json
index 76d8213..a768fcc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -6452,7 +6452,6 @@
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz",
"integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==",
- "dev": true,
"requires": {
"@types/estree": "0.0.39",
"estree-walker": "^1.0.1",
@@ -9258,8 +9257,7 @@
"@types/estree": {
"version": "0.0.39",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
- "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
- "dev": true
+ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw=="
},
"@types/glob": {
"version": "7.1.2",
@@ -15559,8 +15557,7 @@
"estree-walker": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz",
- "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==",
- "dev": true
+ "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg=="
},
"esutils": {
"version": "2.0.3",
@@ -24627,8 +24624,7 @@
"picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
- "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
- "dev": true
+ "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg=="
},
"pidtree": {
"version": "0.3.1",
@@ -28155,6 +28151,14 @@
"fsevents": "~2.1.2"
}
},
+ "rollup-plugin-import-css": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/rollup-plugin-import-css/-/rollup-plugin-import-css-1.1.4.tgz",
+ "integrity": "sha512-xA48wmnnYTiBG2pLyvJHlhspxV3JPjK5quLt9qdWThdK6NL7Ob43LDhLQ28R4yhmJSWaAi3/2bReKzP87qF5nQ==",
+ "requires": {
+ "@rollup/pluginutils": "^3.1.0"
+ }
+ },
"rollup-plugin-livereload": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-livereload/-/rollup-plugin-livereload-2.0.0.tgz",
diff --git a/package.json b/package.json
index 48e36d8..e05c1c6 100644
--- a/package.json
+++ b/package.json
@@ -59,6 +59,7 @@
"postcss": "^7.0.35",
"postcss-import": "^12.0.1",
"postcss-load-config": "^3.0.0",
+ "rollup-plugin-import-css": "^1.1.4",
"sirv-cli": "1.0.10",
"svelte-preprocess": "^4.6.1",
"sveltejs-tippy": "^3.0.0",
diff --git a/rollup.config.js b/rollup.config.js
index d8b4cce..7c811cf 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -6,6 +6,7 @@ import livereload from "rollup-plugin-livereload";
import { terser } from "rollup-plugin-terser";
import { spawn, execSync } from "child_process";
import sveltePreprocess from "svelte-preprocess";
+import css from "rollup-plugin-import-css";
const production = !process.env.ROLLUP_WATCH;
@@ -39,14 +40,15 @@ export default {
file: "public/build/bundle.js",
},
plugins: [
+ css(),
svelte({
// enable run-time checks when not in production
dev: !production,
// we'll extract any component CSS out into
// a separate file - better for performance
preprocess: sveltePreprocess({ postcss: true }),
- css: (css) => {
- css.write("bundle.css");
+ css: (cssFile) => {
+ cssFile.write("bundle.css");
},
}),
// only use google analytics on production builds
@@ -56,6 +58,8 @@ export default {
__VERSION__: execSync("git rev-list HEAD --max-count=1")
.toString()
.trim(),
+ // the version of tippy that sveltejs-tippy includes has node stuff in it
+ "process.env.NODE_ENV": JSON.stringify("production"),
}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment