chore: convert cjs to esm

This commit is contained in:
Enrico Sacchetti 2023-06-23 21:55:21 -04:00
commit 181b9d86a4
No known key found for this signature in database
GPG key ID: 3374B89ECA60D796
3 changed files with 14 additions and 12 deletions

View file

@ -1,5 +1,6 @@
{ {
"private": true, "private": true,
"type": "module",
"scripts": { "scripts": {
"dev": "run-p dev:*", "dev": "run-p dev:*",
"dev:routify": "cross-env NODE_ENV=development routify run", "dev:routify": "cross-env NODE_ENV=development routify run",

View file

@ -1,14 +1,14 @@
const path = require("path"); import path from "node:path";
const { mdsvex } = require("mdsvex"); import fs from "node:fs";
const { parse, walk } = require("svelte/compiler"); import { mdsvex } from "mdsvex";
const slug = require("remark-slug"); import { parse, walk } from "svelte/compiler";
const visit = require("unist-util-visit"); import slug from "remark-slug";
const { format } = require("prettier"); import visit from "unist-util-visit";
const pkg = require("../package.json"); import { format } from "prettier";
const component_api = require("./src/COMPONENT_API.json"); import pkg from "../package.json" assert { type: "json" };
const fs = require("fs"); import component_api from "./src/COMPONENT_API.json" assert { type: "json" };
const Prism = require("prismjs"); import Prism from "prismjs";
require("prism-svelte"); import "prism-svelte";
const component_api_by_name = component_api.components.reduce((a, c) => { const component_api_by_name = component_api.components.reduce((a, c) => {
return { return {
@ -139,7 +139,7 @@ function carbonify() {
}; };
} }
module.exports = { export {
extensions: [".svelte", ".svx"], extensions: [".svelte", ".svx"],
preprocess: [ preprocess: [
{ {

View file

@ -6,6 +6,7 @@
"svelte": "./src/index.js", "svelte": "./src/index.js",
"main": "./lib/index.js", "main": "./lib/index.js",
"module": "./lib/index.mjs", "module": "./lib/index.mjs",
"type": "module",
"types": "./types/index.d.ts", "types": "./types/index.d.ts",
"sideEffects": [ "sideEffects": [
"css/*.css" "css/*.css"