-
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: minimizer initial research using r.js
- Loading branch information
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// this is WIP | ||
// References: | ||
// https://stackoverflow.com/questions/14337970/minifying-requirejs-javascript-codebase-to-a-single-file | ||
// https://github.com/requirejs/r.js | ||
// https://github.com/requirejs/r.js/blob/master/build/example.build.js | ||
// https://requirejs.org/docs/optimization.html | ||
// https://github.com/brackets-cont/brackets/blob/master/Gruntfile.js | ||
|
||
|
||
|
||
({ | ||
// `name` and `out` is set by grunt-usemin | ||
baseUrl: 'src', | ||
optimize: 'uglify2', | ||
// brackets.js should not be loaded until after polyfills defined in "utils/Compatibility" | ||
// so explicitly include it in main.js | ||
include: ["utils/Compatibility", "brackets"], | ||
// TODO: Figure out how to make sourcemaps work with grunt-usemin | ||
// https://github.com/yeoman/grunt-usemin/issues/30 | ||
generateSourceMaps: true, | ||
useSourceUrl: true, | ||
// required to support SourceMaps | ||
// http://requirejs.org/docs/errors.html#sourcemapcomments | ||
preserveLicenseComments: false, | ||
useStrict: true, | ||
// Disable closure, we want define/require to be globals | ||
wrap: false, | ||
paths: { | ||
"text": "thirdparty/text/text", | ||
"i18n": "thirdparty/i18n/i18n", | ||
// The file system implementation. Change this value to use different | ||
// implementations (e.g. cloud-based storage). | ||
"fileSystemImpl": "filesystem/impls/appshell/AppshellFileSystem", | ||
"preact-compat": "thirdparty/preact-compat/preact-compat.min", | ||
"thirdparty/preact": "thirdparty/preact/preact" | ||
}, | ||
uglify2: {}, // https://github.com/mishoo/UglifyJS2 | ||
waitSeconds: 60, | ||
out: "src/brackets-min.js" | ||
}) |