diff --git a/.gitignore b/.gitignore index 2fd7c5e..2196514 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,12 @@ -# Intellij -*.iml -.idea +# editor +.vscode # npm node_modules package-lock.json # build -main.js -*.js.map +build # obsidian data.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..caf36ff --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 TfTHacker + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package.json b/package.json index 29e2406..590496c 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,18 @@ { - "name": "obsidian-sample-plugin", + "name": "obsidian-drag-and-drop-blocks", "version": "0.12.0", - "description": "This is a sample plugin for Obsidian (https://obsidian.md)", + "description": "Drag and Drop Blocks", "main": "main.js", "scripts": { - "dev": "rollup --config rollup.config.js -w", - "build": "rollup --config rollup.config.js --environment BUILD:production" + "dev": "esbuild src/main.ts --bundle --external:obsidian --format=cjs --outfile=build/main.js --watch", + "build": "esbuild src/main.ts --bundle --external:obsidian --format=cjs --outfile=build/main.js" }, "keywords": [], "author": "", "license": "MIT", "devDependencies": { - "@rollup/plugin-commonjs": "^18.0.0", - "@rollup/plugin-node-resolve": "^11.2.1", - "@rollup/plugin-typescript": "^8.2.1", "@types/node": "^14.14.37", "obsidian": "^0.12.0", - "rollup": "^2.32.1", "tslib": "^2.2.0", "typescript": "^4.2.4" } diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index dd4d041..0000000 --- a/rollup.config.js +++ /dev/null @@ -1,30 +0,0 @@ -import typescript from '@rollup/plugin-typescript'; -import {nodeResolve} from '@rollup/plugin-node-resolve'; -import commonjs from '@rollup/plugin-commonjs'; - -const isProd = (process.env.BUILD === 'production'); - -const banner = -`/* -THIS IS A GENERATED/BUNDLED FILE BY ROLLUP -if you want to view the source visit the plugins github repository -*/ -`; - -export default { - input: 'main.ts', - output: { - dir: '.', - sourcemap: 'inline', - sourcemapExcludeSources: isProd, - format: 'cjs', - exports: 'default', - banner, - }, - external: ['obsidian'], - plugins: [ - typescript(), - nodeResolve({browser: true}), - commonjs(), - ] -}; \ No newline at end of file diff --git a/main.ts b/src/main.ts similarity index 100% rename from main.ts rename to src/main.ts