Skip to content

Commit

Permalink
update and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Jul 13, 2022
1 parent 3232281 commit 406e75d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
10 changes: 0 additions & 10 deletions Gulpfile.mjs
Expand Up @@ -671,16 +671,6 @@ gulp.task(
)
);

function watch() {
gulp.watch(defaultSourcesGlob, gulp.task("build-no-bundle-watch"));
gulp.watch(babelStandalonePluginConfigGlob, gulp.task("generate-standalone"));
gulp.watch(buildTypingsWatchGlob, gulp.task("generate-type-helpers"));
gulp.watch(
"./packages/babel-helpers/src/helpers/*.js",
gulp.task("generate-runtime-helpers")
);
}

function watch() {
gulp.watch(defaultSourcesGlob, gulp.task("build-no-bundle-watch"));
gulp.watch(babelStandalonePluginConfigGlob, gulp.task("generate-standalone"));
Expand Down
16 changes: 16 additions & 0 deletions Makefile.mjs
Expand Up @@ -125,6 +125,18 @@ target["clean-runtime-helpers"] = function () {
* BUILD
*/

target["use-cjs"] = function () {
node(["scripts/set-module-type.js", "script"]);

target["bootstrap"]();
};

target["use-esm"] = function () {
node(["scripts/set-module-type.js", "module"]);

target["bootstrap"]();
};

target["bootstrap-only"] = function () {
target["clean-all"]();

Expand All @@ -151,6 +163,8 @@ target["build-standalone"] = function () {
};

target["build-bundle"] = function () {
node(["scripts/set-module-type.js"]);

target["clean"]();
target["clean-lib"]();

Expand All @@ -161,6 +175,8 @@ target["build-bundle"] = function () {
};

target["build-no-bundle"] = function () {
node(["scripts/set-module-type.js"]);

target["clean"]();
target["clean-lib"]();

Expand Down
5 changes: 4 additions & 1 deletion scripts/set-module-type.js
@@ -1,8 +1,11 @@
#!/usr/bin/env node

import fs from "fs";
import { fileURLToPath } from "url";
import path from "path";

const root = rel => new URL(`../${rel}`, import.meta.url).pathname;
const root = rel =>
path.join(fileURLToPath(path.dirname(import.meta.url)), "../", rel);

// prettier-ignore
let moduleType;
Expand Down

0 comments on commit 406e75d

Please sign in to comment.