This repository has been archived by the owner on Aug 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.buildrc.json
94 lines (78 loc) · 4.11 KB
/
example.buildrc.json
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
83
84
85
86
87
88
89
90
91
92
93
94
/**
* This is an example buildrc.json file that demonstrates how to configure the
* grunt-config builder. The buildrc file is **required** for compiling/building
* projects via the `grunt build` command. Visit grunt-config/src/Builder.js for
* further documentation.
*
* NOTE: THIS BUILD FILE WILL NOT WORK. It is referencing paths that probably
* do not exist on your machine. It also contains comments, which aren't
* compatible with json files. Just use it as a guide.
*/
{
// The directory (relative to the buildrc file) that contains your application
// source code. All of your scripts should be in a subdirectory under this
// path. This option defaults to '.'
"sourceDirectory": ".",
// The directory (relative to the buildrc file) to save the outputted build
// files and subdirectories. This option defaults to 'build'
"buildDirectory": "build",
// Compress options for compiling/building the source code. Maps to a object
// literal of compress options. If not specified, the defaults stated
// below will be used.
"compress": {
// Boolean that indicates if the Builder should use Terser to minify code
// when building. See https://terser.org/. Defaults to true.
"minify": true,
// Boolean that indicates if Terser should mangle names when minifying.
// Defaults to true. Will be ignored if minify is false. Defaults to true.
"mangle": true,
// Optional override options to pass to Terser when minifying. Will be
// ignored if minify is false. See https://terser.org/docs/api-reference.
// See grunt-config/src/Builder minify method for default terser options.
"minifyOverrideOptions": {},
// Boolean that indicates if the Builder should use Babel to transpile code
// when building. See https://babeljs.io/. Defaults to true.
"babelTranspile": true,
// Optional override options to pass to Babel when transpiling. Will not be
// used if babelTranspile is false. See https://babeljs.io/docs/en/options.
// See grunt-config/src/Builder transpile method for default babel options.
"babelOverrideOptions": {}
},
// If provided, this will indicate that the project is a requirejs project and
// Builder will use the r.js optimizer before minifying and transpiling.
// See https://requirejs.org/docs/optimization.html.
//
// If not provided, Builder will compile all of the .js files in the source
// directory and copy it to the build directory (with the same relative
// subdirectory paths).
"requirejs": {
// The requirejs config file. See https://requirejs.org/docs/api.html#config
// This path is relative to the sourceDirectory. Will use this file
// to optimize the project. This option is required (if the requirejs key is
// provided).
"configFile": "js/project-name-config.js",
// The single entry point main module name for requirejs that runs the
// project. You can use paths defined in your configFile to reference this
// module.
"mainEntry": "project-name-main",
// The file to output the optimized requirejs project. This path is relative
// to the buildDirectory. This option is required (if the requirejs key is
// provided).
"outputFile": "project-name.min.js",
// Indicates if Builder should generate a index.html file in the
// buildDirectory with the optimized requirejs code (outputted in the
// output file) as the only script of the page. This only works if
// there is an index.html file in the sourceDirectory. See
// grunt-config/src/Builder for more documentation. **Defaults to FALSE.**
"generateBuildHtml": true,
// Optional override options to pass to the r.js optimizer. See
// https://github.com/requirejs/r.js/blob/master/build/example.build.js
// for documentation, as it lists all of the available options.
// See grunt-config/src/Builder optimizeAMD method for default r.js options.
"overrideOptions": {}
},
// If provided, Builder will run this command BEFORE building.
"preBuild": "node run before-building-script",
// If provided, Builder will run this command AFTER building.
"postBuild": "node run after-building-script"
}