make babel a regular dependency

This commit is contained in:
Martina 2021-08-20 14:16:09 -07:00
parent f7bdea0d4a
commit 6411d02c99
4 changed files with 34 additions and 52 deletions

View File

@ -1,32 +1,30 @@
const path = require("path"); const path = require("path");
const dirPath = path.join(__dirname); const dirPath = path.join(__dirname);
if (process.env.NODE_ENV !== "production") { require("@babel/register")({
require("@babel/register")({ presets: [
presets: [ [require.resolve("@babel/preset-env")],
[require.resolve("@babel/preset-env")], [
[ require.resolve("next/babel"),
require.resolve("next/babel"), {
{ "preset-env": {},
"preset-env": {}, "transform-runtime": {},
"transform-runtime": {}, "styled-jsx": {},
"styled-jsx": {}, "class-properties": {},
"class-properties": {}, },
},
],
], ],
plugins: [ ],
[ plugins: [
require.resolve("babel-plugin-module-resolver"), [
{ require.resolve("babel-plugin-module-resolver"),
alias: { {
"~": dirPath, alias: {
}, "~": dirPath,
}, },
], },
], ],
ignore: ["node_modules", ".next"], ],
}); ignore: ["node_modules", ".next"],
} });
module.exports = require("./server.js"); module.exports = require("./server.js");

26
package-lock.json generated
View File

@ -8,6 +8,8 @@
"version": "1.0.0", "version": "1.0.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/core": "^7.15.0",
"@babel/register": "^7.15.3",
"@emotion/babel-preset-css-prop": "11.2.0", "@emotion/babel-preset-css-prop": "11.2.0",
"@emotion/react": "11.1.5", "@emotion/react": "11.1.5",
"@glif/filecoin-number": "^1.1.0-beta.17", "@glif/filecoin-number": "^1.1.0-beta.17",
@ -63,11 +65,9 @@
"ws": "^7.4.3" "ws": "^7.4.3"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.15.0",
"@babel/eslint-parser": "^7.13.8", "@babel/eslint-parser": "^7.13.8",
"@babel/plugin-proposal-optional-chaining": "^7.12.16", "@babel/plugin-proposal-optional-chaining": "^7.12.16",
"@babel/preset-env": "^7.12.16", "@babel/preset-env": "^7.12.16",
"@babel/register": "^7.15.3",
"@rollup/plugin-babel": "^5.3.0", "@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^17.1.0", "@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.1.0", "@rollup/plugin-json": "^4.1.0",
@ -1867,7 +1867,6 @@
"version": "7.15.3", "version": "7.15.3",
"resolved": "https://registry.npmjs.org/@babel/register/-/register-7.15.3.tgz", "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.15.3.tgz",
"integrity": "sha512-mj4IY1ZJkorClxKTImccn4T81+UKTo4Ux0+OFSV9hME1ooqS9UV+pJ6BjD0qXPK4T3XW/KNa79XByjeEMZz+fw==", "integrity": "sha512-mj4IY1ZJkorClxKTImccn4T81+UKTo4Ux0+OFSV9hME1ooqS9UV+pJ6BjD0qXPK4T3XW/KNa79XByjeEMZz+fw==",
"dev": true,
"dependencies": { "dependencies": {
"clone-deep": "^4.0.1", "clone-deep": "^4.0.1",
"find-cache-dir": "^2.0.0", "find-cache-dir": "^2.0.0",
@ -4492,7 +4491,6 @@
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz",
"integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==",
"dev": true,
"dependencies": { "dependencies": {
"is-plain-object": "^2.0.4", "is-plain-object": "^2.0.4",
"kind-of": "^6.0.2", "kind-of": "^6.0.2",
@ -7381,7 +7379,6 @@
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
"integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
"dev": true,
"dependencies": { "dependencies": {
"isobject": "^3.0.1" "isobject": "^3.0.1"
}, },
@ -7393,7 +7390,6 @@
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
"integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
"dev": true,
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }
@ -7745,7 +7741,6 @@
"version": "6.0.3", "version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
"integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
"dev": true,
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }
@ -9689,7 +9684,6 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz",
"integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=",
"dev": true,
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }
@ -10280,7 +10274,6 @@
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz",
"integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==",
"dev": true,
"dependencies": { "dependencies": {
"node-modules-regexp": "^1.0.0" "node-modules-regexp": "^1.0.0"
}, },
@ -11406,7 +11399,6 @@
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz",
"integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==",
"dev": true,
"dependencies": { "dependencies": {
"kind-of": "^6.0.2" "kind-of": "^6.0.2"
}, },
@ -14966,7 +14958,6 @@
"version": "7.15.3", "version": "7.15.3",
"resolved": "https://registry.npmjs.org/@babel/register/-/register-7.15.3.tgz", "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.15.3.tgz",
"integrity": "sha512-mj4IY1ZJkorClxKTImccn4T81+UKTo4Ux0+OFSV9hME1ooqS9UV+pJ6BjD0qXPK4T3XW/KNa79XByjeEMZz+fw==", "integrity": "sha512-mj4IY1ZJkorClxKTImccn4T81+UKTo4Ux0+OFSV9hME1ooqS9UV+pJ6BjD0qXPK4T3XW/KNa79XByjeEMZz+fw==",
"dev": true,
"requires": { "requires": {
"clone-deep": "^4.0.1", "clone-deep": "^4.0.1",
"find-cache-dir": "^2.0.0", "find-cache-dir": "^2.0.0",
@ -17185,7 +17176,6 @@
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz",
"integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==",
"dev": true,
"requires": { "requires": {
"is-plain-object": "^2.0.4", "is-plain-object": "^2.0.4",
"kind-of": "^6.0.2", "kind-of": "^6.0.2",
@ -19417,7 +19407,6 @@
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
"integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
"dev": true,
"requires": { "requires": {
"isobject": "^3.0.1" "isobject": "^3.0.1"
}, },
@ -19425,8 +19414,7 @@
"isobject": { "isobject": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
"integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8="
"dev": true
} }
} }
}, },
@ -19700,8 +19688,7 @@
"kind-of": { "kind-of": {
"version": "6.0.3", "version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
"integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw=="
"dev": true
}, },
"knex": { "knex": {
"version": "0.95.4", "version": "0.95.4",
@ -21231,8 +21218,7 @@
"node-modules-regexp": { "node-modules-regexp": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz",
"integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA="
"dev": true
}, },
"node-releases": { "node-releases": {
"version": "1.1.71", "version": "1.1.71",
@ -21661,7 +21647,6 @@
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz",
"integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==",
"dev": true,
"requires": { "requires": {
"node-modules-regexp": "^1.0.0" "node-modules-regexp": "^1.0.0"
} }
@ -22552,7 +22537,6 @@
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz",
"integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==",
"dev": true,
"requires": { "requires": {
"kind-of": "^6.0.2" "kind-of": "^6.0.2"
} }

View File

@ -32,6 +32,8 @@
}, },
"repository": "filecoin-project/slate", "repository": "filecoin-project/slate",
"dependencies": { "dependencies": {
"@babel/core": "^7.15.0",
"@babel/register": "^7.15.3",
"@emotion/babel-preset-css-prop": "11.2.0", "@emotion/babel-preset-css-prop": "11.2.0",
"@emotion/react": "11.1.5", "@emotion/react": "11.1.5",
"@glif/filecoin-number": "^1.1.0-beta.17", "@glif/filecoin-number": "^1.1.0-beta.17",
@ -87,11 +89,9 @@
"ws": "^7.4.3" "ws": "^7.4.3"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.15.0",
"@babel/eslint-parser": "^7.13.8", "@babel/eslint-parser": "^7.13.8",
"@babel/plugin-proposal-optional-chaining": "^7.12.16", "@babel/plugin-proposal-optional-chaining": "^7.12.16",
"@babel/preset-env": "^7.12.16", "@babel/preset-env": "^7.12.16",
"@babel/register": "^7.15.3",
"@rollup/plugin-babel": "^5.3.0", "@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^17.1.0", "@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.1.0", "@rollup/plugin-json": "^4.1.0",

View File

@ -1,10 +1,10 @@
if (process.env.NODE_ENV !== "production") { if (process.env.NODE_ENV !== "production") {
require("dotenv").config(); require("dotenv").config();
require("@babel/register")({
presets: ["@babel/preset-env"],
ignore: ["node_modules", ".next"],
});
} }
require("@babel/register")({
presets: ["@babel/preset-env"],
ignore: ["node_modules", ".next"],
});
module.exports = require("./" + process.argv[2] + ".js"); module.exports = require("./" + process.argv[2] + ".js");