Skip to content

Commit 9e9b367

Browse files
committed
Include *.inc.js files in gopherjs build mode.
This simply copies the same functionality from ImportPackage(). Perhaps it should be factored into a common function.
1 parent c67fada commit 9e9b367

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

build/build.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,15 @@ func (s *Session) BuildDir(packagePath string, importPath string, pkgObj string)
309309
}
310310
pkg := &PackageData{Package: buildPkg}
311311
pkg.ImportPath = "main"
312+
files, err := ioutil.ReadDir(pkg.Dir)
313+
if err != nil {
314+
return err
315+
}
316+
for _, file := range files {
317+
if strings.HasSuffix(file.Name(), ".inc.js") && file.Name()[0] != '_' {
318+
pkg.JsFiles = append(pkg.JsFiles, file.Name())
319+
}
320+
}
312321
if err := s.BuildPackage(pkg); err != nil {
313322
return err
314323
}

0 commit comments

Comments
 (0)