@@ -4,7 +4,7 @@ import copy from 'rollup-plugin-copy'
4
4
import EnvironmentPlugin from 'vite-plugin-environment'
5
5
import string from 'vite-plugin-string' // Import string plugin
6
6
import viteCommonjs from 'vite-plugin-commonjs' // Import commonjs plugin
7
- import inject from " @rollup/plugin-inject"
7
+ import inject from ' @rollup/plugin-inject'
8
8
import path from 'path'
9
9
10
10
// https://vitejs.dev/config/
@@ -18,11 +18,10 @@ export default defineConfig({
18
18
// Inject global variables for legacy builds
19
19
$ : 'jquery' ,
20
20
jQuery : 'jquery' ,
21
- 'window.jQuery' : 'jquery' ,
22
- 'window.$' : 'jquery' ,
23
21
key : 'keymaster' ,
24
22
'window.key' : 'keymaster' ,
25
23
CodeMirror : '@hackmd/codemirror' ,
24
+ moment : 'moment'
26
25
// Add any other globals you need to inject
27
26
} ) ,
28
27
string ( { // Add string plugin
@@ -139,7 +138,7 @@ export default defineConfig({
139
138
// Example: 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
140
139
__dirname : '""' , // Define __dirname as empty string for browser compatibility
141
140
global : 'globalThis' , // Explicitly define global for Vite
142
- ot : { } , // Define ot as empty object for browser compatibility
141
+ ot : { } // Define ot as empty object for browser compatibility
143
142
} ,
144
143
root : __dirname ,
145
144
base : '/' ,
@@ -157,7 +156,7 @@ export default defineConfig({
157
156
'wurl' ,
158
157
'list.js' ,
159
158
'@hackmd/idle-js' ,
160
- 'spin.js' ,
159
+ 'spin.js'
161
160
// Explicitly include the OT files being imported
162
161
// '@hackmd/ot/lib/client.js',
163
162
// '@hackmd/ot/lib/editor-client.js',
0 commit comments