mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-26 04:19:49 +03:00
only require babel register on dev
This commit is contained in:
parent
dae49fd767
commit
f7bdea0d4a
6
index.js
6
index.js
@ -1,7 +1,8 @@
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const dirPath = path.join(__dirname);
|
const dirPath = path.join(__dirname);
|
||||||
|
|
||||||
require("@babel/register")({
|
if (process.env.NODE_ENV !== "production") {
|
||||||
|
require("@babel/register")({
|
||||||
presets: [
|
presets: [
|
||||||
[require.resolve("@babel/preset-env")],
|
[require.resolve("@babel/preset-env")],
|
||||||
[
|
[
|
||||||
@ -25,6 +26,7 @@ require("@babel/register")({
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
ignore: ["node_modules", ".next"],
|
ignore: ["node_modules", ".next"],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = require("./server.js");
|
module.exports = require("./server.js");
|
||||||
|
@ -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")({
|
require("@babel/register")({
|
||||||
presets: ["@babel/preset-env"],
|
presets: ["@babel/preset-env"],
|
||||||
ignore: ["node_modules", ".next"],
|
ignore: ["node_modules", ".next"],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = require("./" + process.argv[2] + ".js");
|
module.exports = require("./" + process.argv[2] + ".js");
|
||||||
|
Loading…
Reference in New Issue
Block a user