diff --git a/packages/core/compile.entry.js b/packages/core/compile.entry.ts similarity index 100% rename from packages/core/compile.entry.js rename to packages/core/compile.entry.ts diff --git a/packages/core/compile.js b/packages/core/compile.js index ca226eb94..113b0f1f5 100644 --- a/packages/core/compile.js +++ b/packages/core/compile.js @@ -1,5 +1,5 @@ /** - * this is used to point to the right source when development with workspaces + * This entry is for old runtimes which do not support `exports` field in package.json + * https://github.com/facebook/metro/issues/670 */ -// eslint-disable-next-line import/no-unresolved -export * from "./build/compile" +module.exports = require("./build/cjs/compile.js") diff --git a/packages/core/npm/compile.js b/packages/core/npm/compile.js deleted file mode 100644 index bce147372..000000000 --- a/packages/core/npm/compile.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./cjs/compile.js") diff --git a/packages/core/npm/index.js b/packages/core/npm/index.js deleted file mode 100644 index 0ff2fc8f8..000000000 --- a/packages/core/npm/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./cjs/index.js") diff --git a/packages/core/package.json b/packages/core/package.json index 17d3f0dd1..cf2ad8abf 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -43,7 +43,8 @@ "files": [ "LICENSE", "README.md", - "build/" + "build/", + "compile.js" ], "dependencies": { "@babel/runtime": "^7.11.2", diff --git a/scripts/build/bundles.ts b/scripts/build/bundles.ts index 19564bb8e..d997a1667 100644 --- a/scripts/build/bundles.ts +++ b/scripts/build/bundles.ts @@ -32,7 +32,7 @@ export const bundles: readonly BundleDef[] = [ { type: BundleType.UNIVERSAL, packageName: "core", - entry: 'compile.entry.js', + entry: 'compile.entry.ts', label: 'compile', }, {