Skip to content

Commit

Permalink
chore: build @babel/plugin-proposal-optional-chaining and helper-memb…
Browse files Browse the repository at this point in the history
…er-expression-to-functions
  • Loading branch information
JLHwung committed Nov 13, 2020
1 parent ae89c04 commit 9b38e9c
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions Gulpfile.js
Expand Up @@ -102,7 +102,13 @@ const babelVersion =
function buildRollup(packages) {
const sourcemap = process.env.NODE_ENV === "production";
return Promise.all(
packages.map(async ({ src, format, dest, name, filename, version }) => {
packages.map(async ({ src, format, dest, name, filename }) => {
const pkgJSON = require("./" + src + "/package.json");
const version = pkgJSON.version + versionSuffix;
const { dependencies = {}, peerDependencies = {} } = pkgJSON;
const external = Object.keys(dependencies).concat(
Object.keys(peerDependencies)
);
let nodeResolveBrowser = false,
babelEnvName = "rollup";
switch (src) {
Expand All @@ -115,6 +121,7 @@ function buildRollup(packages) {
fancyLog(`Compiling '${chalk.cyan(input)}' with rollup ...`);
const bundle = await rollup.rollup({
input,
external,
plugins: [
rollupBabelSource(),
rollupReplace({
Expand Down Expand Up @@ -161,6 +168,7 @@ function buildRollup(packages) {
format,
name,
sourcemap: sourcemap,
exports: "named",
});

if (!process.env.IS_PUBLISH) {
Expand All @@ -180,6 +188,7 @@ function buildRollup(packages) {
format,
name,
sourcemap: sourcemap,
exports: "named",
plugins: [
rollupTerser({
// workaround https://bugs.webkit.org/show_bug.cgi?id=212725
Expand All @@ -194,13 +203,14 @@ function buildRollup(packages) {
}

const libBundles = [
{
src: "packages/babel-parser",
format: "cjs",
dest: "lib",
version: require("./packages/babel-parser/package").version + versionSuffix,
},
];
"packages/babel-parser",
"packages/babel-plugin-proposal-optional-chaining",
"packages/babel-helper-member-expression-to-functions",
].map(src => ({
src,
format: "cjs",
dest: "lib",
}));

const standaloneBundle = [
{
Expand Down

0 comments on commit 9b38e9c

Please sign in to comment.