diff --git a/.github/workflows/alpha.yaml b/.github/workflows/alpha.yaml index 06721e5..d979923 100644 --- a/.github/workflows/alpha.yaml +++ b/.github/workflows/alpha.yaml @@ -56,6 +56,7 @@ jobs: node-version: current - uses: actions/checkout@v4 - run: npm ci + - run: npm run build - name: Update @v3-alpha version run: npm version premajor --no-git-tag-version --preid "alpha.$GITHUB_RUN_NUMBER" - name: Deploy @v3-alpha version to npm @@ -63,4 +64,3 @@ jobs: with: tag: v3-alpha token: ${{ secrets.NPM_TOKEN }} - check-version: false diff --git a/package.json b/package.json index 5218d73..31038bd 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,18 @@ "editor", "javascript" ], - "main": "dist/node/easymde.js", + "files": [ + "dist", + "CHANGELOG.md" + ], + "main": "dist/node/index.js", "browser": "dist/browser/easymde.min.js", "types": "dist/types/index.d.ts", "license": "MIT", "author": "Jeroen Akkerman", - "repository": "github:Ionaru/easy-markdown-editor", + "repository": { + "url": "git+https://github.com/Ionaru/easy-markdown-editor.git" + }, "scripts": { "build": "rollup -c", "build:watch": "rollup -c -w", diff --git a/rollup.config.js b/rollup.config.js index e05579b..b269897 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -4,6 +4,7 @@ import typescript from "@rollup/plugin-typescript"; import cleaner from "rollup-plugin-cleaner"; import scss from "rollup-plugin-scss"; +/** @type {import('rollup').RollupOptions[]} */ export default [ // Browser configuration { @@ -15,7 +16,7 @@ export default [ }, plugins: [ cleaner({ - targets: ["./dist/"], + targets: ["./dist/browser"], }), nodeResolve(), scss({ @@ -25,4 +26,31 @@ export default [ terser(), ], }, + // Node configuration + { + input: "src/index.ts", + output: { + dir: "dist/node", + sourcemap: true, + }, + external: [ + "marked", + "escape-string-regexp", + "@lezer/highlight", + "@lezer/markdown", + "@codemirror/lang-markdown", + "@codemirror/language", + "@codemirror/state", + "@codemirror/view", + ], + plugins: [ + cleaner({ + targets: ["./dist/node"], + }), + scss({ + fileName: "easymde.css", + }), + typescript(), + ], + }, ]; diff --git a/tsconfig.json b/tsconfig.json index 30f1131..ba54239 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,8 +14,7 @@ "allowJs": true, "strict": true, "target": "es2021", - "skipLibCheck": false, - "outDir": "dist/browser" + "skipLibCheck": false }, "files": ["src/index.ts"] }