Open
Description
In my VueJS binding project Vuejs, I tried
to include different version of Vue Javascript Code
using go building tags,
but the generated js code does not change with or without building tags.
I hava tow files to switch tags: inc_debug.go
//+build debug
package vue
//using vue-2.1.10.inc.js 219K
import _ "github.com/oskca/gopherjs-vue/jscode/debug"
and inc_minified.go
//+build !debug
package vue
//using vue-2.1.10.min.inc.js 71K
import _ "github.com/oskca/gopherjs-vue/jscode/debug"
Steps to show the problem
- RM to clean the build
$ rm -rf $GOPATH/pkg/linux_js/github.com/oskca
- A refresh build works with expected package building sequence
$ gopherjs build -v --tags debug $GOPATH/src/github.com/oskca/gopherjs-vue/examples/basic/basic.go
github.com/oskca/gopherjs-dom
github.com/oskca/gopherjs-json
github.com/oskca/gopherjs-vue/jscode/debug
github.com/oskca/gopherjs-vue
main
- And outputs a debug version
$ lh $GOPATH/src/github.com/oskca/gopherjs-vue/examples/basic/basic.js
-rw-rw-r-- 1 oskca oskca 340K 22:56 basic.js ## bigger file size
- The second build without the building flags
$ gopherjs build -v $GOPATH/src/github.com/oskca/gopherjs-vue/examples/basic/basic.go
github.com/oskca/gopherjs-vue/jscode/minified ## expected
main
- Outputs not change, still the debug version
$ lh $GOPATH/src/github.com/oskca/gopherjs-vue/examples/basic/basic.js
-rw-rw-r-- 1 oskca oskca 340K 22:57 basic.js ## size not change
If you swap setp 3 and step 2
the generated js code would only include the vue-2.1.10.min.inc.js
$ lh $GOPATH/src/github.com/oskca/gopherjs-vue/examples/basic/basic.js
-rw-rw-r-- 1 oskca oskca 192K 23:10 basic.js ## smaller one