mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
chore(examples): use JS import in routify
This commit is contained in:
parent
003246dfe9
commit
281a925714
6 changed files with 1101 additions and 57 deletions
|
@ -21,13 +21,13 @@
|
||||||
"rollup": "^2.18.1",
|
"rollup": "^2.18.1",
|
||||||
"rollup-plugin-copy": "^3.3.0",
|
"rollup-plugin-copy": "^3.3.0",
|
||||||
"rollup-plugin-livereload": "^2.0.0",
|
"rollup-plugin-livereload": "^2.0.0",
|
||||||
|
"rollup-plugin-postcss": "^3.1.8",
|
||||||
"rollup-plugin-svelte": "^5.2.3",
|
"rollup-plugin-svelte": "^5.2.3",
|
||||||
"rollup-plugin-svelte-hot": "^0.9.2",
|
"rollup-plugin-svelte-hot": "^0.9.2",
|
||||||
"rollup-plugin-terser": "^7.0.2",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
"routify-plugin-frontmatter": "^1.0.1",
|
"routify-plugin-frontmatter": "^1.0.1",
|
||||||
"spassr": "^1.1.2",
|
"spassr": "^1.1.2",
|
||||||
"svelte": "^3.23.2",
|
"svelte": "^3.23.2"
|
||||||
"svelte-preprocess": "^4.2.1"
|
|
||||||
},
|
},
|
||||||
"routify": {
|
"routify": {
|
||||||
"extensions": "svelte,md",
|
"extensions": "svelte,md",
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { createRollupConfigs } from "./scripts/base.config.js";
|
import { createRollupConfigs } from "./scripts/base.config.js";
|
||||||
import slug from "remark-slug";
|
import slug from "remark-slug";
|
||||||
import { mdsvex } from "mdsvex";
|
import { mdsvex } from "mdsvex";
|
||||||
import autoPreprocess from "svelte-preprocess";
|
|
||||||
|
|
||||||
const production = !process.env.ROLLUP_WATCH;
|
const production = !process.env.ROLLUP_WATCH;
|
||||||
|
|
||||||
|
@ -13,10 +12,7 @@ export const config = {
|
||||||
production,
|
production,
|
||||||
rollupWrapper: (cfg) => cfg,
|
rollupWrapper: (cfg) => cfg,
|
||||||
svelteWrapper: (svelte) => {
|
svelteWrapper: (svelte) => {
|
||||||
svelte.preprocess = [
|
svelte.preprocess = [mdsvex({ remarkPlugins: [slug], extension: "md" })];
|
||||||
autoPreprocess(),
|
|
||||||
mdsvex({ remarkPlugins: [slug], extension: "md" }),
|
|
||||||
];
|
|
||||||
svelte.extensions = [".svelte", ".md"];
|
svelte.extensions = [".svelte", ".md"];
|
||||||
return svelte;
|
return svelte;
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { terser } from "rollup-plugin-terser";
|
||||||
import copy from "rollup-plugin-copy";
|
import copy from "rollup-plugin-copy";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import replace from "@rollup/plugin-replace";
|
import replace from "@rollup/plugin-replace";
|
||||||
|
import postcss from "rollup-plugin-postcss";
|
||||||
import { spassr } from "spassr";
|
import { spassr } from "spassr";
|
||||||
import { version } from "../package.json";
|
import { version } from "../package.json";
|
||||||
|
|
||||||
|
@ -63,6 +64,10 @@ function baseConfig(config, ctx) {
|
||||||
flatten: false,
|
flatten: false,
|
||||||
}),
|
}),
|
||||||
replace({ "process.env.VERSION": JSON.stringify(version) }),
|
replace({ "process.env.VERSION": JSON.stringify(version) }),
|
||||||
|
postcss({
|
||||||
|
extract: "bundle.css",
|
||||||
|
extensions: [".css"],
|
||||||
|
}),
|
||||||
svelte(svelteWrapper(svelteConfig, ctx)),
|
svelte(svelteWrapper(svelteConfig, ctx)),
|
||||||
resolve({
|
resolve({
|
||||||
browser: true,
|
browser: true,
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import "carbon-components-svelte/css/all.css";
|
||||||
import HMR from "@sveltech/routify/hmr";
|
import HMR from "@sveltech/routify/hmr";
|
||||||
import App from "./App.svelte";
|
import App from "./App.svelte";
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,6 @@
|
||||||
import Theme from "../components/Theme.svelte";
|
import Theme from "../components/Theme.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" global>
|
|
||||||
@import "carbon-components-svelte/css/all";
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<Theme persist theme="g10">
|
<Theme persist theme="g10">
|
||||||
<Navigation />
|
<Navigation />
|
||||||
<Content style="background: none; padding: 1rem">
|
<Content style="background: none; padding: 1rem">
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue