Skip to content
This repository was archived by the owner on May 10, 2021. It is now read-only.

Commit f1d99cf

Browse files
expose next-on-netlify to be required as a module (#64)
1 parent c23aee5 commit f1d99cf

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

index.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const prepareFolders = require("./lib/steps/prepareFolders");
2+
const copyPublicFiles = require("./lib/steps/copyPublicFiles");
3+
const copyNextAssets = require("./lib/steps/copyNextAssets");
4+
const setupPages = require("./lib/steps/setupPages");
5+
const setupRedirects = require("./lib/steps/setupRedirects");
6+
7+
const nextOnNetlify = () => {
8+
prepareFolders();
9+
10+
copyPublicFiles();
11+
12+
copyNextAssets();
13+
14+
setupPages();
15+
16+
setupRedirects();
17+
};
18+
19+
module.exports = nextOnNetlify;

next-on-netlify.js

+2-14
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,9 @@ program
99
)
1010
.parse(process.argv);
1111

12+
const nextOnNetlify = require("./index");
1213
const { logTitle } = require("./lib/helpers/logger");
13-
const prepareFolders = require("./lib/steps/prepareFolders");
14-
const copyPublicFiles = require("./lib/steps/copyPublicFiles");
15-
const copyNextAssets = require("./lib/steps/copyNextAssets");
16-
const setupPages = require("./lib/steps/setupPages");
17-
const setupRedirects = require("./lib/steps/setupRedirects");
1814

19-
prepareFolders();
20-
21-
copyPublicFiles();
22-
23-
copyNextAssets();
24-
25-
setupPages();
26-
27-
setupRedirects();
15+
nextOnNetlify();
2816

2917
logTitle("✅ Success! All done!");

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"author": "Finn Woelm",
2323
"license": "MIT",
2424
"files": [
25-
"/lib"
25+
"/lib",
26+
"index.js"
2627
],
2728
"scripts": {
2829
"format": "prettier --write .",

0 commit comments

Comments
 (0)