Note: Work in progress.
Xone provides 3 ways of managing dependencies:
Define dependencies with goog.provide
and goog.require
in the top of each javascript file:
goog.provide("MyLib.foobar");
goog.require("MyLib.foo");
goog.require("MyLib.bar");
Note: Xone uses a fallback for
goog.provide
andgoog.require
if closure compiler is not available.
In app/manifest.js
set to true
:
"calculate": true
Execute CLI script:
workspace\my_project> xone deps
Note: This scripts also automatically executed in background when running
xone compile
orxone build
.
Define dependencies with goog.provide
and goog.require
in the top of each javascript file:
goog.provide("MyLib.foobar");
goog.require("MyLib.foo");
goog.require("MyLib.bar");
In app/manifest.js
manage your codebase dependencies in any order (supports wildcards):
"dependencies": {
"calculate": false,
"js": [
"js/main.js",
"js/lib/**/*.js",
"js/layout/*.js",
"js/view/*.js",
"js/init.js"
]
}
Execute CLI script:
workspace\my_project> xone compile
Note: Closure Compiler Javascript Version actually do not support dependency sorting by
goog.provide
andgoog.require
. For this case you have to use method 1. or 3. in order.
In app/manifest.js
manage your codebase dependencies manually ordered (did not support wildcards):
"dependencies": {
"js": [
"js/init.js",
"js/layout.js",
"js/view.js",
"js/setup.js",
"js/main.js"
],
"production": [],
"development": [],
"benchmark": [],
"test": [],
"spec": [
"test/helper.js",
"test/main_spec.js"
]
}