genny/assets/webpack/webpack.go
func New(opts *Options) (*genny.Generator, error) {
	g := genny.New()

	if err := opts.Validate(); err != nil {
		return g, err
	}

	g.RunFn(func(r *genny.Runner) error {
		if _, err := r.LookPath("npm"); err != nil {
			return errors.New("could not find npm executable")
		}
		return nil
	})

	g.Box(Templates)

	data := map[string]interface{}{
		"opts": opts,
	}
	t := gogen.TemplateTransformer(data, gogen.TemplateHelpers)
	g.Transformer(t)
	g.Transformer(genny.Dot())

	g.RunFn(func(r *genny.Runner) error {
		return installPkgs(r, opts)
	})

	return g, nil
}
func New(opts *Options) (*genny.Generator, error) {
	g := genny.New()

	if err := opts.Validate(); err != nil {
		return g, err
	}

	g.RunFn(func(r *genny.Runner) error {
		if _, err := r.LookPath("npm"); err != nil {
			return errors.New("could not find npm executable")
		}
		return nil
	})

	g.Box(Templates)

	data := map[string]interface{}{
		"opts": opts,
	}
	t := gogen.TemplateTransformer(data, gogen.TemplateHelpers)
	g.Transformer(t)
	g.Transformer(genny.Dot())

	g.RunFn(func(r *genny.Runner) error {
		return installPkgs(r, opts)
	})

	return g, nil
}
func New ( opts * Options ) ( * genny . Generator , error ) { g := genny . New ( ) if err := opts . Validate ( ) ; err != nil { return g , err } g . RunFn ( func ( r * genny . Runner ) error { if _ , err := r . LookPath ( " " ) ; err != nil { return errors . New ( " " ) } return nil } ) g . Box ( Templates ) data := map [ string ] interface { } { " " : opts , } t := gogen . TemplateTransformer ( data , gogen . TemplateHelpers ) g . Transformer ( t ) g . Transformer ( genny . Dot ( ) ) g . RunFn ( func ( r * genny . Runner ) error { return installPkgs ( r , opts ) } ) return g , nil }
// New generator for creating webpack asset files
New generator for creating webpack asset files