mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
chore: upgrade routify
Support sass and typescript
This commit is contained in:
parent
0f7d96bf37
commit
37e371fd86
11 changed files with 478 additions and 357 deletions
|
@ -1,14 +1,17 @@
|
|||
const path = require("path");
|
||||
const { mdsvex } = require("mdsvex");
|
||||
const { parse, walk } = require("svelte/compiler");
|
||||
const slug = require("remark-slug");
|
||||
const visit = require("unist-util-visit");
|
||||
const { format } = require("prettier");
|
||||
const pkg = require("../package.json");
|
||||
const component_api = require("./src/COMPONENT_API.json");
|
||||
const fs = require("fs");
|
||||
const Prism = require("prismjs");
|
||||
require("prism-svelte");
|
||||
import path from "node:path";
|
||||
import * as url from "node:url";
|
||||
import { mdsvex } from "mdsvex";
|
||||
import { parse, walk } from "svelte/compiler";
|
||||
import slug from "remark-slug";
|
||||
import visit from "unist-util-visit";
|
||||
import { format } from "prettier";
|
||||
import pkg from "../package.json" assert { type: "json" };
|
||||
import component_api from "./src/COMPONENT_API.json" assert { type: "json" };
|
||||
import fs from "node:fs";
|
||||
import Prism from "prismjs";
|
||||
import "prism-svelte";
|
||||
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
||||
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
||||
|
||||
const component_api_by_name = component_api.components.reduce((a, c) => {
|
||||
return {
|
||||
|
@ -139,9 +142,10 @@ function carbonify() {
|
|||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
const config = {
|
||||
extensions: [".svelte", ".svx"],
|
||||
preprocess: [
|
||||
vitePreprocess(),
|
||||
{
|
||||
markup: ({ filename, content }) => {
|
||||
if (/node_modules/.test(filename) || !filename.endsWith(".svelte"))
|
||||
|
@ -223,3 +227,5 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue