-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.config.js
82 lines (74 loc) · 2.3 KB
/
build.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* global module process require */
const cliargs = require("yargs").argv,
builddir = cliargs.builddir || "./build",
pkg = require("./package.json"),
env = {
NODE_ENV: cliargs.node_env || process.env.NODE_ENV || "development",
BRANDING: cliargs.branding || process.env.BRANDING || "default",
API_SERVER: cliargs.server || process.env.API_SERVER || "http://localhost",
PWA: cliargs.pwa === "true" || process.env.PWA === "true",
APP_VERSION: pkg.version
};
module.exports = {
src_dir: "./src/www",
views_dir: "views",
build_dir: builddir,
test_output_dir: `${builddir}/test-results`,
assets: [
"manifest.json",
"*.{html, css, png, jpg}",
"css/**/*",
"font/**/*",
"images/**/*",
"views/**/*",
"!views/**/*.js",
"!views/**/*.less",
"branding/**/*",
"!branding/**/*.less",
"!less"
],
libs: [
// add libraries here that you want to 'require'
{name: "@lib/activables", path: "lib/activables"},
{name: "@lib/clazz", path: "lib/clazz"},
{name: "@lib/touch", path: "lib/touch"},
{name: "@lib/api-client", path: "lib/api-client"},
{name: "@lib/router", path: "lib/router"},
// Components
{name: "@components/actionbar", path: "components/actionbar"},
{name: "@components/form", path: "components/form"},
{name: "@components/list", path: "components/list"},
{name: "@components/overlay", path: "components/overlay"},
{name: "@components/tabs", path: "components/tabs"},
{name: "@components/portal", path: "components/portal"},
{name: "@components/touchable", path: "components/touchable"},
{name: "@components/notification", path: "components/notification"},
{name: "@components/loading-indicator", path: "components/loading-indicator"},
// Services
{name: "@app/config", path: "config"},
{name: "@services/storage", path: "services/storage"}
],
serviceworkers: [
"sw.js",
"sw-config.js"
],
env: env,
browserify: {
// prelude: null,
debug: true,
extensions: [".js", ".json", "!**/__tests__/*.js"],
transform: [
["envify", {
global: true,
_: "purge",
...env
}],
"babelify",
"browserify-shim"
],
sourceMaps: true,
cache: {},
packageCache: {},
plugin: [/* watchify */]
}
};