Skip to content

Default config

Greg Bowler edited this page Oct 19, 2023 · 3 revisions

Use the --default argument to include a default build configuration in your library. This way, a build.json is only required if the developer wants a custom configuration. This is the behaviour of [WebEngine] applications - a build.default.json is provided as part of the WebEngine framework, providing a sensible set of defaults for new projects, and application developers can choose whether to override any particular section to suit their project's needs.

For example: build --default path/to/my/build.default.json

The default WebEngine build configuration is as follows:

build.default.json:

{
	"script/**/*.es6": {
		"require": {
			"node": "*",
			"babel": "*",
			"webpack": "*"
		},
		"execute": {
			"command": "webpack",
			"arguments": ["--entry","./script/script.es6", "--output-path", "./www", "--output-filename", "script.js", "--devtool", "source-map", "--mode", "development"]
		}
	},

	"script/*sw.js": {
		"require": {
			"vendor/bin/sync": "*"
		},
		"execute": {
			"command": "vendor/bin/sync",
			"arguments": ["--pattern", "*sw.js", "script", "www/"]
		}
	},

	"script/**/*.js": {
		"require": {
			"vendor/bin/sync": "*"
		},
		"execute": {
			"command": "vendor/bin/sync",
			"arguments": ["--pattern", "*.js", "script", "www/script"]
		}
	},

	"style/**/*.scss": {
		"require": {
			"sass": "*"
		},
		"execute": {
			"command": "sass",
			"arguments": ["./style/style.scss", "www/style.css"]
		}
	},

	"style/**/*.css": {
		"require": {
			"vendor/bin/sync": "*"
		},
		"execute": {
			"command": "vendor/bin/sync",
			"arguments": ["--pattern", "*.css", "style", "www/style"]
		}
	},

	"asset/**/*": {
		"require": {
			"vendor/bin/sync": ">=1.3.0"
		},
		"execute": {
			"command": "vendor/bin/sync",
			"arguments": ["./asset", "./www/asset", "--symlink"]
		}
	}
}

This is called automatically as part of the gt build command, which is WebEngine-specific functionality.

Clone this wiki locally