O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting familiar with GopherJS on the command line

The gopherjs command is very similar to the go command. For example, to transpile a Go program into its JavaScript representation, we issue the gopherjs build command like this:

$ gopherjs build

To build a GopherJS project and minify the produced JavaScript source file, we specify the -m flag along with the gopherjs build command:

$ gopherjs build -m

When we perform a build operation, GopherJS will create both a .js source file and a .js.map source file.

The .js.map files are called source maps. They help us map a minified JavaScript source file back to its unbuilt state. This feature comes in handy when we chase down errors using the web browser console.

The JavaScript source file, generated ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required