Skip to content

Commit 4793154

Browse files
committed
fix: update Vite config to exclude HTML and CSS files from processing
1 parent ab8a835 commit 4793154

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

vite.config.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ export default defineConfig({
2121
key: 'keymaster',
2222
'window.key': 'keymaster',
2323
CodeMirror: '@hackmd/codemirror',
24-
moment: 'moment'
25-
// Add any other globals you need to inject
24+
moment: 'moment',
25+
// Add exclude for HTML files to prevent inject plugin from processing them
26+
exclude: ['**/*.html', '**/*.css']
2627
}),
27-
string({ // Add string plugin
28-
include: '**/*.html' // Load all .html files as strings
28+
string({
29+
include: '**/*.html'
2930
}),
3031
copy({
3132
targets: [
@@ -130,7 +131,8 @@ export default defineConfig({
130131
cover: path.resolve(__dirname, 'public/js/cover.js'),
131132
pretty: path.resolve(__dirname, 'public/js/pretty.js'),
132133
slide: path.resolve(__dirname, 'public/js/slide.js')
133-
}
134+
},
135+
external: [/\.html$/]
134136
}
135137
},
136138
// Define global constants like webpack DefinePlugin (if needed)

0 commit comments

Comments
 (0)