@@ -66,7 +66,7 @@ type Action struct {
6666 showValidate bool
6767 auditInsert func (* types.AuditEvent ) error
6868 containerManager any // Container manager, if available, used to run commands in the container
69- jsLibs []types.JSLibrary
69+ esmLibs []types.JSLibrary
7070}
7171
7272// NewAction creates a new action
@@ -119,8 +119,11 @@ func NewAction(logger *types.Logger, sourceFS *appfs.SourceFs, isDev bool, name,
119119 hiddenParams [h ] = true
120120 }
121121
122- if len (jsLibs ) == 0 {
123- jsLibs = []types.JSLibrary {* & types.JSLibrary {}}
122+ esmLibs := []types.JSLibrary {}
123+ for _ , lib := range jsLibs {
124+ if lib .LibType == types .ESModule {
125+ esmLibs = append (esmLibs , lib )
126+ }
124127 }
125128
126129 return & Action {
@@ -142,7 +145,7 @@ func NewAction(logger *types.Logger, sourceFS *appfs.SourceFs, isDev bool, name,
142145 showValidate : showValidate ,
143146 auditInsert : auditInsert ,
144147 containerManager : containerManager ,
145- jsLibs : jsLibs ,
148+ esmLibs : esmLibs ,
146149 // Links, AppTemplate and Theme names are initialized later
147150 }, nil
148151}
@@ -457,7 +460,7 @@ func (a *Action) execAction(w http.ResponseWriter, r *http.Request, isSuggest, i
457460 "path" : a .pagePath ,
458461 "lightTheme" : a .LightTheme ,
459462 "darkTheme" : a .DarkTheme ,
460- "jsLibs " : a . jsLibs ,
463+ "esmLibs " : a . esmLibs ,
461464 }
462465
463466 if ! isHtmxRequest {
@@ -815,7 +818,7 @@ func (a *Action) getForm(w http.ResponseWriter, r *http.Request) {
815818 "hasFileUpload" : hasFileUpload ,
816819 "showSuggest" : a .suggest != nil ,
817820 "showValidate" : a .showValidate ,
818- "jsLibs " : a . jsLibs ,
821+ "esmLibs " : a . esmLibs ,
819822 }
820823 err := a .actionTemplate .ExecuteTemplate (w , "form.go.html" , input )
821824 if err != nil {
0 commit comments