mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
chore: convert cjs to esm
This commit is contained in:
parent
ab1693bcc4
commit
181b9d86a4
3 changed files with 14 additions and 12 deletions
|
@ -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",
|
||||||
|
|
|
@ -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: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue