|
| 1 | +// this is WIP |
| 2 | +// References: |
| 3 | +// https://stackoverflow.com/questions/14337970/minifying-requirejs-javascript-codebase-to-a-single-file |
| 4 | +// https://github.com/requirejs/r.js |
| 5 | +// https://github.com/requirejs/r.js/blob/master/build/example.build.js |
| 6 | +// https://requirejs.org/docs/optimization.html |
| 7 | +// https://github.com/brackets-cont/brackets/blob/master/Gruntfile.js |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +({ |
| 12 | + // `name` and `out` is set by grunt-usemin |
| 13 | + baseUrl: 'src', |
| 14 | + optimize: 'uglify2', |
| 15 | + // brackets.js should not be loaded until after polyfills defined in "utils/Compatibility" |
| 16 | + // so explicitly include it in main.js |
| 17 | + include: ["utils/Compatibility", "brackets"], |
| 18 | + // TODO: Figure out how to make sourcemaps work with grunt-usemin |
| 19 | + // https://github.com/yeoman/grunt-usemin/issues/30 |
| 20 | + generateSourceMaps: true, |
| 21 | + useSourceUrl: true, |
| 22 | + // required to support SourceMaps |
| 23 | + // http://requirejs.org/docs/errors.html#sourcemapcomments |
| 24 | + preserveLicenseComments: false, |
| 25 | + useStrict: true, |
| 26 | + // Disable closure, we want define/require to be globals |
| 27 | + wrap: false, |
| 28 | + paths: { |
| 29 | + "text": "thirdparty/text/text", |
| 30 | + "i18n": "thirdparty/i18n/i18n", |
| 31 | + // The file system implementation. Change this value to use different |
| 32 | + // implementations (e.g. cloud-based storage). |
| 33 | + "fileSystemImpl": "filesystem/impls/appshell/AppshellFileSystem", |
| 34 | + "preact-compat": "thirdparty/preact-compat/preact-compat.min", |
| 35 | + "thirdparty/preact": "thirdparty/preact/preact" |
| 36 | + }, |
| 37 | + uglify2: {}, // https://github.com/mishoo/UglifyJS2 |
| 38 | + waitSeconds: 60, |
| 39 | + out: "src/brackets-min.js" |
| 40 | +}) |
0 commit comments