Skip to content

Commit

Permalink
Use plain js to do the pre/postpublish for the polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Sep 1, 2016
1 parent 2664c16 commit 56eb8d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -43,7 +43,6 @@
"readline-sync": "^1.2.19",
"rimraf": "^2.4.3",
"semver": "^5.0.0",
"shelljs": "^0.7.4",
"through2": "^2.0.0",
"uglify-js": "^2.4.16"
},
Expand Down
8 changes: 7 additions & 1 deletion packages/babel-polyfill/scripts/postpublish.js
@@ -1 +1,7 @@
rm(__dirname + "/../browser.js");
var fs = require("fs");
var path = require("path");

try {
fs.unlinkSync(path.join(__dirname, "../browser.js"));
} catch (err) {}

7 changes: 4 additions & 3 deletions packages/babel-polyfill/scripts/prepublish.js
@@ -1,7 +1,8 @@
require("shelljs/global");
var fs = require("fs");
var path = require("path");

function relative(loc) {
return __dirname + "/../" + loc;
return path.join(__dirname, "..", loc);
}

cp(relative("dist/polyfill.min.js"), relative("browser.js"));
fs.writeFileSync(relative("browser.js"), fs.readFileSync(relative("dist/polyfill.min.js")));

0 comments on commit 56eb8d2

Please sign in to comment.