Skip to content

Commit

Permalink
Adjust build - rollup is failing for a number of reasons. Esbuild works.
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipjohnston committed Mar 11, 2022
1 parent 9759e27 commit 54d4a3a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 43 deletions.
28 changes: 28 additions & 0 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import esbuild from "esbuild";
import process from "process";
import builtins from 'builtin-modules'

const banner =
`/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
`;

const prod = (process.argv[2] === 'production');

esbuild.build({
banner: {
js: banner,
},
entryPoints: ['main.ts'],
bundle: true,
external: ['obsidian', 'electron', ...builtins],
format: 'cjs',
watch: !prod,
target: 'es2016',
logLevel: "info",
sourcemap: prod ? false : 'inline',
treeShaking: true,
outfile: 'main.js',
}).catch(() => process.exit(1));
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"name": "obsidian-pandoc-plugin",
"version": "0.1.0",
"version": "0.3.0",
"description": "This is a Pandoc export plugin for Obsidian (https://obsidian.md)",
"main": "main.js",
"scripts": {
"dev": "rollup --config rollup.config.js -w",
"build": "rollup --config rollup.config.js --environment BUILD:production"
"dev": "node esbuild.config.mjs",
"build": "node esbuild.config.mjs production"
},
"keywords": [],
"author": "Oliver Balfour",
"author": "Obsidian Community",
"license": "MIT",
"devDependencies": {
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-typescript": "^6.0.0",
"@types/node": "^14.14.2",
"obsidian": "https://github.com/obsidianmd/obsidian-api/tarball/master",
"rollup": "^2.32.1",
"tslib": "^2.0.3",
"typescript": "^4.0.3"
"@types/node": "^16.11.6",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"builtin-modules": "^3.2.0",
"esbuild": "0.13.12",
"obsidian": "^0.12.17",
"tslib": "2.3.1",
"typescript": "4.4.4"
},
"dependencies": {
"@types/temp": "^0.9.0",
Expand Down
30 changes: 0 additions & 30 deletions rollup.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"0.2.2": "0.12.5",
"0.2.3": "0.12.5",
"0.2.4": "0.12.5",
"0.2.5": "0.12.5"
"0.2.5": "0.12.5",
"0.3.0": "0.12.5",
}

0 comments on commit 54d4a3a

Please sign in to comment.