Repository navigation
Expand file tree
/
Copy pathpackage-scripts.js
More file actions
115 lines (113 loc) · 3.09 KB
/
Copy pathpackage-scripts.js
File metadata and controls
115 lines (113 loc) · 3.09 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
const npsUtils = require('nps-utils');
// <-------------- Development Port --------------> //
const PORT = 3000;
module.exports = {
scripts: {
default: {
// NPM START for deployment
script: 'nps browserSync.production',
hiddenFromHelp: true,
},
build: {
script: 'nps parcel.dom.build',
description: 'Build DOM for production',
},
/*
<==========================================>
< DOM >
<==========================================>
*/
dom: {
// Development mode
default: {
script: npsUtils.concurrent.nps(
'parcel.dom',
'browserSync',
),
description: 'Development mode for DOM',
},
// Builds
build: {
default: {
script: 'nps parcel.dom.build',
description: 'Build DOM project',
},
run: {
script: npsUtils.series.nps(
'parcel.dom.build',
'browserSync.production',
),
description: 'Build DOM project and run server',
},
},
test: {
/*
TODO
- Summary: Testing for Frontend
* Description: Testing tool might get added in the future
*/
script: '',
description: '',
hiddenFromHelp: true,
},
},
/*
<==========================================>
< BrowserSync >
<==========================================>
*/
browserSync: {
default: {
script: `cross-env NODE_ENV=development browser-sync start --server dist --files "dist/" --port ${PORT} `,
hiddenFromHelp: true,
},
production: {
script: `cross-env NODE_ENV=production browser-sync start --server prod --files "prod/" --port ${PORT} `,
hiddenFromHelp: true,
},
},
/*
<==========================================>
< Parcel >
<==========================================>
*/
parcel: {
dom: {
default: {
script:
'cross-env NODE_ENV=development parcel watch src/index.html --public-url ./ --out-dir dist --target browser',
hiddenFromHelp: true,
},
build: {
script:
'cross-env NODE_ENV=production parcel build src/index.html --out-dir prod --target browser',
hiddenFromHelp: true,
},
},
},
/*
<==========================================>
< EsLint >
<==========================================>
*/
eslint: {
default: {
script: 'eslint --fix --no-ignore **/*.js',
hiddenFromHelp: true,
},
},
/*
<==========================================>
< Others >
<==========================================>
*/
localTunnel: {
script: `lt --port ${PORT} `,
description: `Expose localhost port ${PORT} `,
},
update: {
script: 'npx npm-check -u',
description: 'Package interactive updater',
},
},
};