Skip to content

Commit

Permalink
Fixed vite 2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
torenware committed Jul 17, 2022
1 parent a581b80 commit d975ba3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/sample-program/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Usage of ./test_program:

You'll need to have the make utility and npm installed for the demo.

The Makefile for the sample project is pretty full featured, since I use it to test this module. Some feature you might find useful to test your own project:
The Makefile for the sample project is pretty full featured, since I use it to test this module. Some features you might find useful to test your own project:

| Make Invocation | What It Does |
|:--- |:--- |
Expand Down
10 changes: 3 additions & 7 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ func (vc *ViteConfig) parsePackageJSON() (*PackageJSON, error) {
}

func analyzePackageJSON(pkgJSON *PackageJSON) *JSAppParams {
semVer, err := regexp.Compile(`^\^((\d+)\.\d+\.\d+)$`)
if err != nil {
// remove once we verify the regexp
panic(err)
}
semVer := regexp.MustCompile(`^[\^]*((\d+)\.\d+\.\d+)$`)

// parse for a ver; return the full version,
// and the major version. Empty strings if
Expand All @@ -69,8 +65,8 @@ func analyzePackageJSON(pkgJSON *PackageJSON) *JSAppParams {
var major string
var fullVers string
if matches != nil {
major = matches[1]
fullVers = matches[2]
major = matches[2]
fullVers = matches[1]
}
return major, fullVers
}
Expand Down

0 comments on commit d975ba3

Please sign in to comment.