Function
launchEditor
(projectPath: string, port: string)
Source from the content-addressed store, hash-verified
| 2 | import {createServer} from 'vite'; |
| 3 | |
| 4 | export async function launchEditor(projectPath: string, port: string) { |
| 5 | const server = await createServer({ |
| 6 | configFile: false, |
| 7 | plugins: [ |
| 8 | motionCanvas({ |
| 9 | project: projectPath, |
| 10 | buildForEditor: false, |
| 11 | }), |
| 12 | ], |
| 13 | build: { |
| 14 | minify: false, |
| 15 | rollupOptions: { |
| 16 | output: { |
| 17 | entryFileNames: '[name].js', |
| 18 | }, |
| 19 | }, |
| 20 | }, |
| 21 | server: { |
| 22 | port: parseInt(port), |
| 23 | }, |
| 24 | }); |
| 25 | |
| 26 | return server.listen(); |
| 27 | } |
Tested by
no test coverage detected