Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f479027
refactor: migrate from Webpack to Vite for build and development proc…
Yukaii Apr 4, 2025
e710517
refactor: update imports and modularize utility functions for better …
Yukaii Apr 4, 2025
5f9387c
feat: add @hackmd/ot package and integrate operational transformation
Yukaii Apr 4, 2025
3d870f9
feat: add @rollup/plugin-inject for global variable injection and upd…
Yukaii Apr 4, 2025
36fbb73
fix: import boostrap
Yukaii Apr 5, 2025
28991c1
fix: editor import
Yukaii Apr 5, 2025
283b5f0
fix: standardize import quotes and update global variable injection
Yukaii Apr 5, 2025
db87b6f
feat: add Bootstrap and Select2 imports; update CSS import paths
Yukaii Apr 5, 2025
285716f
fix: pretty imports
Yukaii Apr 5, 2025
59bdeaa
fix: slide
Yukaii Apr 5, 2025
2fded95
feat: add CSS order fixer script for development mode
Yukaii Apr 5, 2025
1f8df85
fix: update nonce variable in CSS order fixer script for development …
Yukaii Apr 5, 2025
ab8a835
remove unused vite scripts
Yukaii Apr 5, 2025
4793154
fix: update Vite config to exclude HTML and CSS files from processing
Yukaii Apr 5, 2025
f1048c2
fix: vite build
Yukaii Apr 5, 2025
f2e683d
fix: update vite manifest path for producdtion
Yukaii Apr 5, 2025
d033817
fix: import Vite in app.js for development server setup
Yukaii Apr 5, 2025
2321d6b
fix: /config endpoint resolving
Yukaii Apr 5, 2025
d4c949a
fix: update PDFObject import for compatibility with dev and prod buil…
Yukaii Apr 5, 2025
d52c088
fix: rename vite config to mjs
Yukaii Apr 6, 2025
5595d31
fix: update PDFObject import for compatibility; add global-ot initial…
Yukaii Apr 6, 2025
5aba200
fix: import Fork Awesome CSS in multiple files; update Vite config fo…
Yukaii Apr 6, 2025
4ecd231
fix: workaround assets ordering by providing a manully ordering array
Yukaii Apr 6, 2025
a59d060
fix: improve manifest reading and caching logic; invalidate cache on …
Yukaii Apr 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: standardize import quotes and update global variable injection
  • Loading branch information
Yukaii committed Apr 5, 2025
commit 283b5f04aaa6c18ab12b83ca0fdddf34258bf7f9
9 changes: 4 additions & 5 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import copy from 'rollup-plugin-copy'
import EnvironmentPlugin from 'vite-plugin-environment'
import string from 'vite-plugin-string' // Import string plugin
import viteCommonjs from 'vite-plugin-commonjs' // Import commonjs plugin
import inject from "@rollup/plugin-inject"
import inject from '@rollup/plugin-inject'
import path from 'path'

// https://vitejs.dev/config/
Expand All @@ -18,11 +18,10 @@ export default defineConfig({
// Inject global variables for legacy builds
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
'window.$': 'jquery',
key: 'keymaster',
'window.key': 'keymaster',
CodeMirror: '@hackmd/codemirror',
moment: 'moment'
// Add any other globals you need to inject
}),
string({ // Add string plugin
Expand Down Expand Up @@ -139,7 +138,7 @@ export default defineConfig({
// Example: 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
__dirname: '""', // Define __dirname as empty string for browser compatibility
global: 'globalThis', // Explicitly define global for Vite
ot: {}, // Define ot as empty object for browser compatibility
ot: {} // Define ot as empty object for browser compatibility
},
root: __dirname,
base: '/',
Expand All @@ -157,7 +156,7 @@ export default defineConfig({
'wurl',
'list.js',
'@hackmd/idle-js',
'spin.js',
'spin.js'
// Explicitly include the OT files being imported
// '@hackmd/ot/lib/client.js',
// '@hackmd/ot/lib/editor-client.js',
Expand Down