build.js 430 Bytes
Newer Older
1
const execSync = require("child_process").execSync;
Wee committed
2 3 4

const exec = (command, extraEnv) =>
  execSync(command, {
5
    stdio: "inherit",
Wee committed
6
    env: Object.assign({}, process.env, extraEnv)
7
  });
Wee committed
8

9
console.log("Building CommonJS modules ...");
Wee committed
10

11 12 13
exec("babel modules -d . --ignore react-router,", {
  BABEL_ENV: "cjs"
});
Wee committed
14

15
console.log("\nBuilding ES modules ...");
Wee committed
16

17 18 19
exec("babel modules -d es --ignore react-router", {
  BABEL_ENV: "es"
});