-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathpostbuild.js
More file actions
21 lines (18 loc) · 980 Bytes
/
postbuild.js
File metadata and controls
21 lines (18 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var fs = require('fs')
var path = __dirname + '/../dist/angular-cache.js'
var file = fs.readFileSync(path, { encoding: 'utf8' })
file = file.replace(
'module.exports = factory(require(\'angular\'))',
'module.exports = factory(typeof angular === \'undefined\' ? require(\'angular\') : angular)'
)
// var index = file.indexOf('babelHelpers;')
// var str = 'var babelHelpers = {};\n' +
// ' babelHelpers.typeof = typeof Symbol === "function" && babelHelpers.typeof(Symbol.iterator) === "symbol" ? function (obj) {\n' +
// ' return typeof obj === "undefined" ? "undefined" : babelHelpers.typeof(obj);\n' +
// ' } : function (obj) {\n' +
// ' return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj === "undefined" ? "undefined" : babelHelpers.typeof(obj);\n' +
// ' };'
// var index2 = file.indexOf(str)
// var file2 = file.substring(index2 + str.length)
// file = file.substring(0, index) + file2
fs.writeFileSync(path, file)