forked from argenos/nldates-obsidian
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minify main.js to improve plugin load time
Fixes argenos#161 Add minification to the build process for `main.js`. * **rollup.config.js** - Import `esbuild` from `rollup-plugin-esbuild` and `terser` from `rollup-plugin-terser`. - Add `esbuild` and `terser` to the `plugins` array for minification. * **package.json** - Add `rollup-plugin-esbuild` as a devDependency. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/argenos/nldates-obsidian/issues/161?shareId=XXXX-XXXX-XXXX-XXXX).
- Loading branch information
Showing
2 changed files
with
19 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import typescript from "@rollup/plugin-typescript"; | ||
import { nodeResolve } from "@rollup/plugin-node-resolve"; | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
|
||
export default { | ||
input: "src/main.ts", | ||
output: { | ||
dir: ".", | ||
sourcemap: "inline", | ||
format: "cjs", | ||
exports: "default", | ||
}, | ||
external: ["obsidian"], | ||
plugins: [typescript(), nodeResolve({ browser: true }), commonjs()], | ||
}; | ||
import typescript from "@rollup/plugin-typescript"; | ||
import { nodeResolve } from "@rollup/plugin-node-resolve"; | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
import esbuild from "rollup-plugin-esbuild"; | ||
import { terser } from "rollup-plugin-terser"; | ||
|
||
export default { | ||
input: "src/main.ts", | ||
output: { | ||
dir: ".", | ||
sourcemap: "inline", | ||
format: "cjs", | ||
exports: "default", | ||
}, | ||
external: ["obsidian"], | ||
plugins: [typescript(), nodeResolve({ browser: true }), commonjs(), esbuild({ minify: true }), terser()], | ||
}; |