Changed build back to esbuild
This commit is contained in:
4
assets/.gitignore
vendored
4
assets/.gitignore
vendored
@@ -1,4 +0,0 @@
|
||||
# Exclude index and cache files on user side by default
|
||||
*Cache.json
|
||||
*Index.json
|
||||
*.data
|
||||
69
esbuild.config.mjs
Normal file
69
esbuild.config.mjs
Normal file
@@ -0,0 +1,69 @@
|
||||
import { build } from 'esbuild'
|
||||
import sveltePlugin from 'esbuild-svelte'
|
||||
import sveltePreprocess from 'svelte-preprocess'
|
||||
import { copy } from 'esbuild-plugin-copy'
|
||||
import process from 'process'
|
||||
import builtins from 'builtin-modules'
|
||||
import path from 'path'
|
||||
|
||||
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'
|
||||
|
||||
build({
|
||||
banner: {
|
||||
js: banner,
|
||||
},
|
||||
entryPoints: ['./src/main.ts'],
|
||||
bundle: true,
|
||||
external: [
|
||||
'obsidian',
|
||||
'electron',
|
||||
'@codemirror/autocomplete',
|
||||
'@codemirror/closebrackets',
|
||||
'@codemirror/collab',
|
||||
'@codemirror/commands',
|
||||
'@codemirror/comment',
|
||||
'@codemirror/fold',
|
||||
'@codemirror/gutter',
|
||||
'@codemirror/highlight',
|
||||
'@codemirror/history',
|
||||
'@codemirror/language',
|
||||
'@codemirror/lint',
|
||||
'@codemirror/matchbrackets',
|
||||
'@codemirror/panel',
|
||||
'@codemirror/rangeset',
|
||||
'@codemirror/rectangular-selection',
|
||||
'@codemirror/search',
|
||||
'@codemirror/state',
|
||||
'@codemirror/stream-parser',
|
||||
'@codemirror/text',
|
||||
'@codemirror/tooltip',
|
||||
'@codemirror/view',
|
||||
...builtins,
|
||||
],
|
||||
outfile: path.join('./dist', 'main.js'),
|
||||
plugins: [
|
||||
sveltePlugin({
|
||||
preprocess: sveltePreprocess(),
|
||||
}),
|
||||
copy({
|
||||
assets: {
|
||||
from: ['./assets/styles.css', 'manifest.json'],
|
||||
to: ['./'],
|
||||
},
|
||||
}),
|
||||
],
|
||||
format: 'cjs',
|
||||
watch: !prod,
|
||||
target: 'chrome98',
|
||||
logLevel: 'info',
|
||||
sourcemap: prod ? false : 'inline',
|
||||
treeShaking: true,
|
||||
minify: prod,
|
||||
legalComments: 'none',
|
||||
}).catch(() => process.exit(1))
|
||||
13
package.json
13
package.json
@@ -4,8 +4,8 @@
|
||||
"description": "A search engine for Obsidian",
|
||||
"main": "dist/main.js",
|
||||
"scripts": {
|
||||
"dev": "rollup -c -w",
|
||||
"build": "rollup -c",
|
||||
"dev": "node esbuild.config.mjs",
|
||||
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json",
|
||||
"version": "node version-bump.mjs && git add manifest.json versions.json package.json",
|
||||
"test": "jest"
|
||||
@@ -27,17 +27,14 @@
|
||||
"@types/pako": "^2.0.0",
|
||||
"babel-jest": "^27.5.1",
|
||||
"builtin-modules": "^3.3.0",
|
||||
"esbuild": "0.13.12",
|
||||
"esbuild-plugin-copy": "^1.3.0",
|
||||
"esbuild-svelte": "^0.7.1",
|
||||
"jest": "^27.5.1",
|
||||
"obsidian": "latest",
|
||||
"obsidian-text-extract": "link:C:/Dev/Obsidian/obsidian-text-extract/dist",
|
||||
"prettier": "^2.7.1",
|
||||
"prettier-plugin-svelte": "^2.8.0",
|
||||
"rollup": "^2.79.1",
|
||||
"rollup-plugin-base64": "^1.0.1",
|
||||
"rollup-plugin-copy": "^3.4.0",
|
||||
"rollup-plugin-svelte": "^7.1.0",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"rollup-plugin-web-worker-loader": "^1.6.1",
|
||||
"svelte": "^3.51.0",
|
||||
"svelte-check": "^2.9.2",
|
||||
"svelte-jester": "^2.3.2",
|
||||
|
||||
1050
pnpm-lock.yaml
generated
1050
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user