forked from reactstrap/reactstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostbuild.js
More file actions
26 lines (21 loc) · 786 Bytes
/
Copy pathpostbuild.js
File metadata and controls
26 lines (21 loc) · 786 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
var fs = require('fs');
// Ensure that any optional peer dependency (e.g. ReactTransitionGroup and
// ReactPopper) are properly set as optional globals. Specifically, do not
// error if the user has not loaded these dependencies. Degrade gracefully.
fs.readFile(__dirname + '/../dist/reactstrap.min.js', 'utf8', function(err, data) {
if (err) {
return console.error(err);
}
var result = data.replace(
/\,([a-zA-Z]+)\.ReactTransitionGroup\.Transition/,
',$1.ReactTransitionGroup && $1.ReactTransitionGroup.Transition || undefined'
).replace(
/\,([a-zA-Z]+)\.ReactPopper/,
',$1.ReactPopper || undefined'
);
fs.writeFile(__dirname + '/../dist/reactstrap.min.js', result, 'utf8', function(err) {
if (err) {
console.error(err);
}
});
});