Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

fix webpack to run locally on windows #168

Merged
merged 3 commits into from
Jan 24, 2017
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
3 changes: 2 additions & 1 deletion buffalo/cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"strings"
"time"

"github.com/gobuffalo/buffalo/buffalo/cmd/generate"
"github.com/gobuffalo/velvet"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -70,7 +71,7 @@ func (b *builder) buildWebpack() error {
_, err := os.Stat("webpack.config.js")
if err == nil {
// build webpack
return b.exec("./node_modules/webpack/bin/webpack.js")
return b.exec(generate.WebpackPath)
}
return nil
}
Expand Down
3 changes: 2 additions & 1 deletion buffalo/cmd/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"os"
"os/exec"

"github.com/gobuffalo/buffalo/buffalo/cmd/generate"
"github.com/markbates/refresh/refresh"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -73,7 +74,7 @@ func startWebpack(ctx context.Context) error {
// there's no webpack, so don't do anything
return nil
}
cmd := exec.Command("./node_modules/webpack/bin/webpack.js", "--watch")
cmd := exec.Command(generate.WebpackPath, "--watch")
cmd.Stdin = os.Stdin
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
Expand Down
4 changes: 4 additions & 0 deletions buffalo/cmd/generate/webpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ package generate
import (
"fmt"
"os/exec"
"path/filepath"

"github.com/markbates/gentronics"
"github.com/spf13/cobra"
)

// WebpackPath is the path to the local install of webpack
var WebpackPath = filepath.Join("node_modules", ".bin", "webpack")

var publicLogo = &gentronics.RemoteFile{
File: gentronics.NewFile("public/assets/images/logo.svg", ""),
RemotePath: "https://raw.githubusercontent.com/gobuffalo/buffalo/master/logo.svg",
Expand Down