Skip to content
Open
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
2 changes: 1 addition & 1 deletion config/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Version of Fn CLI
var Version = "0.6.8"
var Version = "0.6.9"

func GetVersion(versionType string) string {
base := "https://github.com/fnproject/cli/releases"
Expand Down
10 changes: 9 additions & 1 deletion langs/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ func (h *NodeLangHelper) Entrypoint() (string, error) {
func (h *NodeLangHelper) DockerfileBuildCmds() []string {
r := []string{}
// skip npm -install if node_modules is local - allows local development
if exists("package.json") && !exists("node_modules") {
if exists("dist") {
// Do nothing
} else if exists("package.json") && !exists("node_modules") {
if exists("package-lock.json") {
r = append(r, "ADD package-lock.json /function/")
}
Expand All @@ -112,7 +114,13 @@ func (h *NodeLangHelper) DockerfileBuildCmds() []string {
}

func (h *NodeLangHelper) DockerfileCopyCmds() []string {
// If they have a dist folder (likely from webpack) let's just include that
if exists("dist") {
r := []string{"ADD dist/main.js /function/func.js"}
return r
}
// excessive but content could be anything really

r := []string{"ADD . /function/"}
if exists("package.json") && !exists("node_modules") {
r = append(r, "COPY --from=build-stage /function/node_modules/ /function/node_modules/")
Expand Down