Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DevServer ¶
type DevServer struct {
// contains filtered or unexported fields
}
DevServer represents a webpack dev server.
func NewDevServer ¶
NewDevServer creates a new instance of DevServer. Note, that the server is not started at this point. The dir argument specifies the directory containing the webpack configuration. Context, command and args are passed to exec.CommandContext. A typical usage would be:
NewDevServer(ctx, "./frontend", "webpack", "serve", "-c", "webpack.dev.js")
Additional, optional configuration is possible via the Configure method.
func (*DevServer) Configure ¶
func (ds *DevServer) Configure(opts ...DevServerOption)
Configure applies options and mus be called before Start.
type DevServerFlags ¶
type DevServerFlags struct { WebpackDir string `` /* 182-byte string literal not displayed */ WebpackServer string `subcmd:"webpack-server,,set to the url of an already running webpack dev server to which requests will be proxied."` }
DevServerFlags represents the flags commonly used when using webpack dev servers.
type DevServerOption ¶
type DevServerOption func(ds *DevServer)
DevServerOption represents an option to Configure.
func AddrRegularExpression ¶
func AddrRegularExpression(re *regexp.Regexp) DevServerOption
AddrRegularExpression specifies the regular expression to use for determining the running server's address. The default RE is: 'Project is running at'. However, some configurations may use a different output.
func SetSdoutStderr ¶
func SetSdoutStderr(stdout, stderr io.Writer) DevServerOption
SetSdoutStderr sets the stdout and stderr io.Writers to be used by the dev server.