Skip to content

Commit

Permalink
Merge pull request #21 from emersonbottero/export-mjs
Browse files Browse the repository at this point in the history
chore: change export format
  • Loading branch information
emersonbottero committed Sep 24, 2022
2 parents 8890903 + fc7fb1a commit 5eb7add
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from "vitepress";
import { withMermaid } from "../../src";

import { version } from "../../package.json";

export default withMermaid(
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vitepress-plugin-mermaid",
"version": "2.0.7",
"version": "2.0.8",
"description": "Add mermaid support for Vitepress",
"scripts": {
"dev": "vite build --watch",
Expand All @@ -17,10 +17,10 @@
"dist"
],
"main": "./dist/vitepress-plugin-mermaid.umd.js",
"module": "./dist/vitepress-plugin-mermaid.es.js",
"module": "./dist/vitepress-plugin-mermaid.es.mjs",
"exports": {
".": {
"import": "./dist/vitepress-plugin-mermaid.es.js",
"import": "./dist/vitepress-plugin-mermaid.es.mjs",
"require": "./dist/vitepress-plugin-mermaid.umd.js"
},
"./Mermaid.vue": "./dist/Mermaid.vue"
Expand Down
Empty file removed src/test.js
Empty file.
5 changes: 4 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ module.exports = defineConfig({
lib: {
entry: path.resolve(__dirname, "src/index.ts"),
name: "MermaidPlugin",
fileName: (format: string) => `vitepress-plugin-mermaid.${format}.js`,
fileName: (format: string) =>
format == "es"
? `vitepress-plugin-mermaid.${format}.mjs`
: `vitepress-plugin-mermaid.${format}.js`,
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
Expand Down

0 comments on commit 5eb7add

Please sign in to comment.