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
|
node-version: current
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
- run: npm run build
|
||||||
- name: Update @v3-alpha version
|
- name: Update @v3-alpha version
|
||||||
run: npm version premajor --no-git-tag-version --preid "alpha.$GITHUB_RUN_NUMBER"
|
run: npm version premajor --no-git-tag-version --preid "alpha.$GITHUB_RUN_NUMBER"
|
||||||
- name: Deploy @v3-alpha version to npm
|
- name: Deploy @v3-alpha version to npm
|
||||||
@ -63,4 +64,3 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
tag: v3-alpha
|
tag: v3-alpha
|
||||||
token: ${{ secrets.NPM_TOKEN }}
|
token: ${{ secrets.NPM_TOKEN }}
|
||||||
check-version: false
|
|
||||||
|
10
package.json
10
package.json
@ -9,12 +9,18 @@
|
|||||||
"editor",
|
"editor",
|
||||||
"javascript"
|
"javascript"
|
||||||
],
|
],
|
||||||
"main": "dist/node/easymde.js",
|
"files": [
|
||||||
|
"dist",
|
||||||
|
"CHANGELOG.md"
|
||||||
|
],
|
||||||
|
"main": "dist/node/index.js",
|
||||||
"browser": "dist/browser/easymde.min.js",
|
"browser": "dist/browser/easymde.min.js",
|
||||||
"types": "dist/types/index.d.ts",
|
"types": "dist/types/index.d.ts",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "Jeroen Akkerman",
|
"author": "Jeroen Akkerman",
|
||||||
"repository": "github:Ionaru/easy-markdown-editor",
|
"repository": {
|
||||||
|
"url": "git+https://github.com/Ionaru/easy-markdown-editor.git"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
"build:watch": "rollup -c -w",
|
"build:watch": "rollup -c -w",
|
||||||
|
@ -4,6 +4,7 @@ import typescript from "@rollup/plugin-typescript";
|
|||||||
import cleaner from "rollup-plugin-cleaner";
|
import cleaner from "rollup-plugin-cleaner";
|
||||||
import scss from "rollup-plugin-scss";
|
import scss from "rollup-plugin-scss";
|
||||||
|
|
||||||
|
/** @type {import('rollup').RollupOptions[]} */
|
||||||
export default [
|
export default [
|
||||||
// Browser configuration
|
// Browser configuration
|
||||||
{
|
{
|
||||||
@ -15,7 +16,7 @@ export default [
|
|||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
cleaner({
|
cleaner({
|
||||||
targets: ["./dist/"],
|
targets: ["./dist/browser"],
|
||||||
}),
|
}),
|
||||||
nodeResolve(),
|
nodeResolve(),
|
||||||
scss({
|
scss({
|
||||||
@ -25,4 +26,31 @@ export default [
|
|||||||
terser(),
|
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,
|
"allowJs": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"target": "es2021",
|
"target": "es2021",
|
||||||
"skipLibCheck": false,
|
"skipLibCheck": false
|
||||||
"outDir": "dist/browser"
|
|
||||||
},
|
},
|
||||||
"files": ["src/index.ts"]
|
"files": ["src/index.ts"]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user