Merge pull request #20 from Flow-Works/thin-dev-branch
[🚑] Fixed plugins not loading
This commit is contained in:
commit
79119e2335
4 changed files with 30 additions and 8 deletions
19
package-lock.json
generated
19
package-lock.json
generated
|
|
@ -21,6 +21,7 @@
|
|||
"ts-standard": "^12.0.2",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^4.4.11",
|
||||
"vite-plugin-dynamic-import": "^1.5.0",
|
||||
"vite-plugin-node-polyfills": "^0.15.0"
|
||||
}
|
||||
},
|
||||
|
|
@ -1927,6 +1928,12 @@
|
|||
"safe-array-concat": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/es-module-lexer": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.1.tgz",
|
||||
"integrity": "sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/es-set-tostringtag": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz",
|
||||
|
|
@ -5930,6 +5937,18 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"node_modules/vite-plugin-dynamic-import": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/vite-plugin-dynamic-import/-/vite-plugin-dynamic-import-1.5.0.tgz",
|
||||
"integrity": "sha512-Qp85c+AVJmLa8MLni74U4BDiWpUeFNx7NJqbGZyR2XJOU7mgW0cb7nwlAMucFyM4arEd92Nfxp4j44xPi6Fu7g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"acorn": "^8.8.2",
|
||||
"es-module-lexer": "^1.2.1",
|
||||
"fast-glob": "^3.2.12",
|
||||
"magic-string": "^0.30.1"
|
||||
}
|
||||
},
|
||||
"node_modules/vite-plugin-node-polyfills": {
|
||||
"version": "0.15.0",
|
||||
"resolved": "https://registry.npmjs.org/vite-plugin-node-polyfills/-/vite-plugin-node-polyfills-0.15.0.tgz",
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
"ts-standard": "^12.0.2",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^4.4.11",
|
||||
"vite-plugin-dynamic-import": "^1.5.0",
|
||||
"vite-plugin-node-polyfills": "^0.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@ import { StatusItem } from './types'
|
|||
|
||||
class StatusBar {
|
||||
pluginList: string[] = [
|
||||
'./modules/appLauncher.ts',
|
||||
'./modules/apps.ts',
|
||||
'./modules/weather.ts',
|
||||
'./modules/clock.ts',
|
||||
'./modules/switcher.ts',
|
||||
'./modules/battery.ts'
|
||||
'appLauncher',
|
||||
'apps',
|
||||
'weather',
|
||||
'clock',
|
||||
'switcher',
|
||||
'battery'
|
||||
]
|
||||
|
||||
plugins: StatusItem[] = []
|
||||
|
|
@ -40,7 +40,7 @@ class StatusBar {
|
|||
window.preloader.setStatus('importing default plugins...')
|
||||
|
||||
for (const pluginPath of this.pluginList) {
|
||||
const plugin = await import(pluginPath)
|
||||
const plugin = await import(`./modules/${pluginPath}.ts`)
|
||||
|
||||
window.preloader.setStatus(`importing default plugins\n${pluginPath}`)
|
||||
this.add(plugin)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import { defineConfig } from 'vite'
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills'
|
||||
import dynamicImport from 'vite-plugin-dynamic-import'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
nodePolyfills()
|
||||
nodePolyfills(),
|
||||
dynamicImport()
|
||||
]
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue