Skip to content

Commit

Permalink
copy automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
abentkamp committed Oct 21, 2023
1 parent 60ee990 commit edf8478
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
client/dist
server/build
client/public/package_versions.json
dist
1 change: 0 additions & 1 deletion client/public/index.production.min.js

This file was deleted.

1 change: 0 additions & 1 deletion client/public/loader.production.min.js

This file was deleted.

Binary file removed client/public/onigasm.wasm
Binary file not shown.
21 changes: 0 additions & 21 deletions client/public/react-dom.production.min.js

This file was deleted.

1 change: 0 additions & 1 deletion client/public/react-jsx-runtime.production.min.js

This file was deleted.

1 change: 0 additions & 1 deletion client/public/react-popper.production.min.js

This file was deleted.

1 change: 0 additions & 1 deletion client/public/react.production.min.js

This file was deleted.

4 changes: 3 additions & 1 deletion client/src/monacoSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js'
import { MonacoServices } from 'monaco-languageclient';
import { StandaloneServices } from 'vscode/services';
import getMessageServiceOverride from 'vscode/service-override/messages';
//@ts-ignore
import onigasmUrl from 'onigasm/lib/onigasm.wasm?url'

export function monacoSetup () {

Expand Down Expand Up @@ -62,7 +64,7 @@ export function monacoSetup () {
// Load onigasm
(async () => {
try {
await loadWASM('./onigasm.wasm')
await loadWASM(onigasmUrl)
} catch (err) {
// Hot module replacement can cause us to run this code twice and that's ok.
if (!(err as Error).message?.startsWith('Onigasm#init has been called')) {
Expand Down
54 changes: 54 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"style-loader": "^3.3.1",
"ts-loader": "^9.4.1",
"typescript": "^4.8.4",
"vite-plugin-static-copy": "^0.17.0",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1"
Expand All @@ -66,7 +67,7 @@
"start_client": "NODE_ENV=development vite",
"build": "npm run build_server && npm run build_client",
"build_server": "server/build.sh",
"build_client": "NODE_ENV=production webpack",
"build_client": "NODE_ENV=production vite build",
"production": "NODE_ENV=production node server/index.js"
},
"browserslist": {
Expand Down
12 changes: 11 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { viteStaticCopy } from 'vite-plugin-static-copy'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [
react(),
viteStaticCopy({
targets: [
{
src: 'node_modules/@leanprover/infoview/dist/*.production.min.js',
dest: '/'
}
]
})],
publicDir: "client/public",
server: {
proxy: {
Expand Down

0 comments on commit edf8478

Please sign in to comment.