Skip to content

Commit 283b5f0

Browse files
committed
fix: standardize import quotes and update global variable injection
1 parent 28991c1 commit 283b5f0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Diff for: vite.config.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import copy from 'rollup-plugin-copy'
44
import EnvironmentPlugin from 'vite-plugin-environment'
55
import string from 'vite-plugin-string' // Import string plugin
66
import viteCommonjs from 'vite-plugin-commonjs' // Import commonjs plugin
7-
import inject from "@rollup/plugin-inject"
7+
import inject from '@rollup/plugin-inject'
88
import path from 'path'
99

1010
// https://vitejs.dev/config/
@@ -18,11 +18,10 @@ export default defineConfig({
1818
// Inject global variables for legacy builds
1919
$: 'jquery',
2020
jQuery: 'jquery',
21-
'window.jQuery': 'jquery',
22-
'window.$': 'jquery',
2321
key: 'keymaster',
2422
'window.key': 'keymaster',
2523
CodeMirror: '@hackmd/codemirror',
24+
moment: 'moment'
2625
// Add any other globals you need to inject
2726
}),
2827
string({ // Add string plugin
@@ -139,7 +138,7 @@ export default defineConfig({
139138
// Example: 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
140139
__dirname: '""', // Define __dirname as empty string for browser compatibility
141140
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
143142
},
144143
root: __dirname,
145144
base: '/',
@@ -157,7 +156,7 @@ export default defineConfig({
157156
'wurl',
158157
'list.js',
159158
'@hackmd/idle-js',
160-
'spin.js',
159+
'spin.js'
161160
// Explicitly include the OT files being imported
162161
// '@hackmd/ot/lib/client.js',
163162
// '@hackmd/ot/lib/editor-client.js',

0 commit comments

Comments
 (0)