forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreact-dom.js
More file actions
30 lines (26 loc) · 827 Bytes
/
react-dom.js
File metadata and controls
30 lines (26 loc) · 827 Bytes
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
'use strict';
var grunt = require('grunt');
var UglifyJS = require('uglify-js');
var LICENSE_TEMPLATE =
grunt.file.read('./grunt/data/header-template-extended.txt');
function build(name, filename) {
var srcFile = `vendor/${filename}.js`;
var destFile = `build/${filename}.js`;
var destFileMin = `build/${filename}.min.js`;
var templateData = {
package: name,
version: grunt.config.data.pkg.version,
};
var header = grunt.template.process(
LICENSE_TEMPLATE,
{data: templateData}
);
var src = grunt.file.read(srcFile);
var srcMin = UglifyJS.minify(src, {fromString: true}).code;
grunt.file.write(destFile, header + src);
grunt.file.write(destFileMin, header + srcMin);
}
module.exports = function() {
build('ReactDOM', 'react-dom');
build('ReactDOMServer', 'react-dom-server');
};