mirror of
https://github.com/foomo/gotsrpc.git
synced 2025-10-16 12:35:35 +00:00
Added dot slash to the import statements in commonjs mode
This commit is contained in:
parent
09adce0133
commit
42d37654e2
2
build.go
2
build.go
@ -41,7 +41,7 @@ func commonJSImports(conf *config.Config, c *code, tsFilename string) {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
c.l("import * as " + importMapping.TypeScriptModule + " from '" + relativePath + "'; // " + tsFilename + " to " + importMapping.Out)
|
||||
c.l("import * as " + importMapping.TypeScriptModule + " from './" + relativePath + "'; // " + tsFilename + " to " + importMapping.Out)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ func main() {
|
||||
|
||||
conf, err := config.LoadConfigFile(args[0])
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "config load error, could not load config from", args[0])
|
||||
fmt.Fprintln(os.Stderr, "config load error, could not load config from", args[0], ":", err)
|
||||
os.Exit(2)
|
||||
}
|
||||
gotsrpc.Build(conf, goPath)
|
||||
|
||||
@ -39,7 +39,7 @@ type Config struct {
|
||||
func LoadConfigFile(file string) (conf *Config, err error) {
|
||||
yamlBytes, readErr := ioutil.ReadFile(file)
|
||||
if readErr != nil {
|
||||
err = readErr
|
||||
err = errors.New("could not read config file: " + readErr.Error())
|
||||
return
|
||||
}
|
||||
return loadConfig(yamlBytes)
|
||||
@ -49,7 +49,7 @@ func loadConfig(yamlBytes []byte) (conf *Config, err error) {
|
||||
conf = &Config{}
|
||||
yamlErr := yaml.Unmarshal(yamlBytes, conf)
|
||||
if yamlErr != nil {
|
||||
err = yamlErr
|
||||
err = errors.New("could not parse yaml: " + yamlErr.Error())
|
||||
return
|
||||
}
|
||||
switch conf.ModuleKind {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user