mirror of
https://github.com/runofthemillgeek/swarnam-obsidian.git
synced 2025-01-18 13:50:12 +00:00
Use rollup for bundling.
This commit is contained in:
parent
5b96e4a095
commit
245339d8e0
11
package.json
11
package.json
@ -4,15 +4,20 @@
|
|||||||
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
|
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "tsc --project tsconfig.json -w",
|
"dev": "rollup --config rollup.config.js -w",
|
||||||
"build": "tsc --project tsconfig.json"
|
"build": "rollup --config rollup.config.js"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"obsidian": "https://github.com/obsidianmd/obsidian-api/tarball/master",
|
"@rollup/plugin-commonjs": "^15.1.0",
|
||||||
|
"@rollup/plugin-node-resolve": "^9.0.0",
|
||||||
|
"@rollup/plugin-typescript": "^6.0.0",
|
||||||
"@types/node": "^14.14.2",
|
"@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"
|
"typescript": "^4.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
19
rollup.config.js
Normal file
19
rollup.config.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import typescript from '@rollup/plugin-typescript';
|
||||||
|
import {nodeResolve} from '@rollup/plugin-node-resolve';
|
||||||
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
input: 'main.ts',
|
||||||
|
output: {
|
||||||
|
dir: '.',
|
||||||
|
sourcemap: 'inline',
|
||||||
|
format: 'cjs',
|
||||||
|
exports: 'default'
|
||||||
|
},
|
||||||
|
external: ['obsidian'],
|
||||||
|
plugins: [
|
||||||
|
typescript(),
|
||||||
|
nodeResolve({browser: true}),
|
||||||
|
commonjs(),
|
||||||
|
]
|
||||||
|
};
|
@ -3,11 +3,12 @@
|
|||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"inlineSourceMap": true,
|
"inlineSourceMap": true,
|
||||||
"inlineSources": true,
|
"inlineSources": true,
|
||||||
"module": "CommonJS",
|
"module": "ESNext",
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
|
"importHelpers": true,
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"es5",
|
"es5",
|
||||||
|
Loading…
Reference in New Issue
Block a user