This repository was archived by the owner on Jan 28, 2025. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathpackage-scripts.js
More file actions
145 lines (143 loc) · 3.98 KB
/
Copy pathpackage-scripts.js
File metadata and controls
145 lines (143 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
const npsUtils = require('nps-utils');
// <-------------- Development PORT --------------> //
const PORT = 3000;
module.exports = {
scripts: {
default: {
// NPM START for deployment
script: 'nps nodemon.node.production',
hiddenFromHelp: true,
},
build: {
script: npsUtils.series.nps('parcel.node.build'),
description: 'Build Node for production',
},
/*
<==========================================>
< Node.js >
<==========================================>
*/
node: {
// Development mode
default: {
script: npsUtils.concurrent.nps(
'parcel.node',
'nodemon.node',
),
description: 'Development mode for Node.js',
},
// Builds
build: {
default: {
script: npsUtils.series.nps('parcel.node.build'),
description: 'Build Node.js project',
},
run: {
script: npsUtils.series.nps(
'parcel.node.build',
'nodemon.node',
),
description: 'Build Node.js project and run server',
},
},
test: {
default: {
script:
'cross-env NODE_ENV=development mocha --require babel-core/register src/**/*.test.js',
description: 'Mocha test',
},
watch: {
script:
'cross-env NODE_ENV=development nodemon --exec "npm start node.test"',
description: 'Mocha test watcher',
},
},
// Debug mode
debug: {
script: npsUtils.concurrent.nps(
'parcel.node',
'nodemon.node.debug',
),
description: 'Debug Node.js project',
},
},
/*
<==========================================>
< Nodemon >
<==========================================>
*/
nodemon: {
node: {
// Default as development
default: {
script:
'cross-env NODE_ENV=development nodemon ./dist/app.js',
hiddenFromHelp: true,
},
production: {
script:
'cross-env NODE_ENV=production nodemon ./prod/app.js',
hiddenFromHelp: true,
},
debug: {
script: 'nodemon --inspect-brk dist/app.js',
hiddenFromHelp: true,
},
},
},
/*
<==========================================>
< Parcel >
<==========================================>
*/
parcel: {
node: {
default: {
script:
'cross-env NODE_ENV=development parcel watch src/app.js --public-url ./ --target node',
hiddenFromHelp: true,
},
build: {
script:
'cross-env NODE_ENV=production parcel build src/app.js --public-url ./ --out-dir prod --target node --no-cache --no-source-maps',
hiddenFromHelp: true,
},
},
},
/*
<==========================================>
< EsLint >
<==========================================>
*/
eslint: {
default: {
script: 'eslint --fix --no-ignore **/*.js',
description: 'Run Eslint Fix',
},
},
/*
<==========================================>
< MongoDB >
<==========================================>
*/
// <-------------- Add your own MongoDB path --------------> //
mongodb: {
script: 'mongod.exe --dbpath \\path-to-MongoDB-data\\',
description: 'Run MongoDB server',
hiddenFromHelp: true,
},
/*
<==========================================>
< Others >
<==========================================>
*/
localTunnel: {
script: `lt --port ${PORT} `,
description: `Expose localhost port ${PORT}`,
},
update: {
script: 'npx npm-check -u',
description: 'Package interactive updater',
},
},
};