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

Commit

Permalink
Merge pull request #168 from gobuffalo/fix-local-webpack
Browse files Browse the repository at this point in the history
fix webpack to run locally on windows
  • Loading branch information
markbates committed Jan 24, 2017
2 parents 521cc34 + 1b9c6ad commit 6def5ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
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

0 comments on commit 6def5ff

Please sign in to comment.