mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-31 13:54:28 -06:00
Add Node build
This commit is contained in:
parent
bc16a40ea0
commit
ee0aa6f0d1
2
.github/workflows/alpha.yaml
vendored
2
.github/workflows/alpha.yaml
vendored
@ -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
|
||||
|
10
package.json
10
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",
|
||||
|
@ -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(),
|
||||
],
|
||||
},
|
||||
];
|
||||
|
@ -14,8 +14,7 @@
|
||||
"allowJs": true,
|
||||
"strict": true,
|
||||
"target": "es2021",
|
||||
"skipLibCheck": false,
|
||||
"outDir": "dist/browser"
|
||||
"skipLibCheck": false
|
||||
},
|
||||
"files": ["src/index.ts"]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user