Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Shared::LayoutHead < BaseComponent
utf8_charset
title "My App - #{@page_title}"
css_link asset("css/app.css")
js_link asset("js/app.js"), defer: "true"
js_link asset("js/app.js"), defer: "true", type: "module"
csrf_meta_tags
responsive_meta_tag

Expand Down
15 changes: 13 additions & 2 deletions src/browser_app_skeleton/vite.config.js.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default defineConfig({
// Asset output configuration
assetsDir: 'assets',
// Source maps for production
sourcemap: process.env.NODE_ENV === 'production' ? false : 'inline'
sourcemap: process.env.NODE_ENV === "production" ? false : true,
},

// CSS configuration
Expand All @@ -49,7 +49,18 @@ export default defineConfig({
// Enable HMR
hmr: {
host: 'localhost'
}
},
// Exclude non-frontend directories from file watching to prevent memory leaks
watch: {
ignored: [
"**", // Ignore all files and subdirectories in the root
"!**/src/js/**", // Re-include the 'src/js' directory
"!**/src/css/**", // Re-include the 'src/css' directory
"!**/public/**", // Re-include the 'public' directory
"!**/vite.config.js", // Ensure the config file itself is watched
// Add other specific folders you want to watch with the '!**/{folderName}/**' pattern
],
},
},

// Preview server configuration (for testing production builds)
Expand Down