parcel 2.0.0-dev.1422 → 2.0.0-dev.1423
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +31 -1
- package/package.json +14 -14
- package/src/cli.js +34 -1
package/lib/cli.js
CHANGED
|
@@ -131,14 +131,42 @@ process.on('unhandledRejection', handleUncaughtException);
|
|
|
131
131
|
program.storeOptionsAsProperties();
|
|
132
132
|
program.version(_package.version);
|
|
133
133
|
|
|
134
|
+
// Only display choices available to callers OS
|
|
135
|
+
let watcherBackendChoices = ['brute-force'];
|
|
136
|
+
switch (process.platform) {
|
|
137
|
+
case 'darwin':
|
|
138
|
+
{
|
|
139
|
+
watcherBackendChoices.push('watchman', 'fs-events');
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
case 'linux':
|
|
143
|
+
{
|
|
144
|
+
watcherBackendChoices.push('watchman', 'inotify');
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
case 'win32':
|
|
148
|
+
{
|
|
149
|
+
watcherBackendChoices.push('watchman', 'windows');
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
case 'freebsd' || 'openbsd':
|
|
153
|
+
{
|
|
154
|
+
watcherBackendChoices.push('watchman');
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
default:
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
|
|
134
161
|
// --no-cache, --cache-dir, --no-source-maps, --no-autoinstall, --global?, --public-url, --log-level
|
|
135
162
|
// --no-content-hash, --experimental-scope-hoisting, --detailed-report
|
|
136
|
-
|
|
137
163
|
const commonOptions = {
|
|
138
164
|
'--no-cache': 'disable the filesystem cache',
|
|
139
165
|
'--config <path>': 'specify which config to use. can be a path or a package name',
|
|
140
166
|
'--cache-dir <path>': 'set the cache directory. defaults to ".parcel-cache"',
|
|
141
167
|
'--watch-dir <path>': 'set the root watch directory. defaults to nearest lockfile or source control dir.',
|
|
168
|
+
'--watch-ignore [path]': [`list of directories watcher should not be tracking for changes. defaults to ['.git', '.hg']`, dirs => dirs.split(',')],
|
|
169
|
+
'--watch-backend': new (_commander().default.Option)('--watch-backend <name>', 'set watcher backend').choices(watcherBackendChoices),
|
|
142
170
|
'--no-source-maps': 'disable sourcemaps',
|
|
143
171
|
'--target [name]': ['only build given target(s)', (val, list) => list.concat([val]), []],
|
|
144
172
|
'--log-level <level>': new (_commander().default.Option)('--log-level <level>', 'set the log level').choices(['none', 'error', 'warn', 'info', 'verbose']),
|
|
@@ -454,6 +482,8 @@ async function normalizeOptions(command, inputFS) {
|
|
|
454
482
|
shouldDisableCache: command.cache === false,
|
|
455
483
|
cacheDir: command.cacheDir,
|
|
456
484
|
watchDir: command.watchDir,
|
|
485
|
+
watchBackend: command.watchBackend,
|
|
486
|
+
watchIgnore: command.watchIgnore,
|
|
457
487
|
config: command.config,
|
|
458
488
|
mode,
|
|
459
489
|
hmrOptions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parcel",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.1423+8b1749694",
|
|
4
4
|
"description": "Blazing fast, zero configuration web application bundler",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
"node": ">= 12.0.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@parcel/config-default": "2.0.0-dev.
|
|
25
|
-
"@parcel/core": "2.0.0-dev.
|
|
26
|
-
"@parcel/diagnostic": "2.0.0-dev.
|
|
27
|
-
"@parcel/events": "2.0.0-dev.
|
|
28
|
-
"@parcel/feature-flags": "2.12.1-dev.
|
|
29
|
-
"@parcel/fs": "2.0.0-dev.
|
|
30
|
-
"@parcel/logger": "2.0.0-dev.
|
|
31
|
-
"@parcel/package-manager": "2.0.0-dev.
|
|
32
|
-
"@parcel/reporter-cli": "2.0.0-dev.
|
|
33
|
-
"@parcel/reporter-dev-server": "2.0.0-dev.
|
|
34
|
-
"@parcel/reporter-tracer": "2.12.1-dev.
|
|
35
|
-
"@parcel/utils": "2.0.0-dev.
|
|
24
|
+
"@parcel/config-default": "2.0.0-dev.1425+8b1749694",
|
|
25
|
+
"@parcel/core": "2.0.0-dev.1423+8b1749694",
|
|
26
|
+
"@parcel/diagnostic": "2.0.0-dev.1425+8b1749694",
|
|
27
|
+
"@parcel/events": "2.0.0-dev.1425+8b1749694",
|
|
28
|
+
"@parcel/feature-flags": "2.12.1-dev.3262+8b1749694",
|
|
29
|
+
"@parcel/fs": "2.0.0-dev.1425+8b1749694",
|
|
30
|
+
"@parcel/logger": "2.0.0-dev.1425+8b1749694",
|
|
31
|
+
"@parcel/package-manager": "2.0.0-dev.1425+8b1749694",
|
|
32
|
+
"@parcel/reporter-cli": "2.0.0-dev.1425+8b1749694",
|
|
33
|
+
"@parcel/reporter-dev-server": "2.0.0-dev.1425+8b1749694",
|
|
34
|
+
"@parcel/reporter-tracer": "2.12.1-dev.3262+8b1749694",
|
|
35
|
+
"@parcel/utils": "2.0.0-dev.1425+8b1749694",
|
|
36
36
|
"chalk": "^4.1.0",
|
|
37
37
|
"commander": "^7.0.0",
|
|
38
38
|
"get-port": "^4.2.0"
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"@babel/core": "^7.22.11",
|
|
42
42
|
"@parcel/babel-register": "2.12.0"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "8b1749694c0ef79cefdacad40bb90c869a93993a"
|
|
45
45
|
}
|
package/src/cli.js
CHANGED
|
@@ -66,9 +66,31 @@ process.on('unhandledRejection', handleUncaughtException);
|
|
|
66
66
|
program.storeOptionsAsProperties();
|
|
67
67
|
program.version(version);
|
|
68
68
|
|
|
69
|
+
// Only display choices available to callers OS
|
|
70
|
+
let watcherBackendChoices = ['brute-force'];
|
|
71
|
+
switch (process.platform) {
|
|
72
|
+
case 'darwin': {
|
|
73
|
+
watcherBackendChoices.push('watchman', 'fs-events');
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
case 'linux': {
|
|
77
|
+
watcherBackendChoices.push('watchman', 'inotify');
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
case 'win32': {
|
|
81
|
+
watcherBackendChoices.push('watchman', 'windows');
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case 'freebsd' || 'openbsd': {
|
|
85
|
+
watcherBackendChoices.push('watchman');
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
default:
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
|
|
69
92
|
// --no-cache, --cache-dir, --no-source-maps, --no-autoinstall, --global?, --public-url, --log-level
|
|
70
93
|
// --no-content-hash, --experimental-scope-hoisting, --detailed-report
|
|
71
|
-
|
|
72
94
|
const commonOptions = {
|
|
73
95
|
'--no-cache': 'disable the filesystem cache',
|
|
74
96
|
'--config <path>':
|
|
@@ -76,6 +98,14 @@ const commonOptions = {
|
|
|
76
98
|
'--cache-dir <path>': 'set the cache directory. defaults to ".parcel-cache"',
|
|
77
99
|
'--watch-dir <path>':
|
|
78
100
|
'set the root watch directory. defaults to nearest lockfile or source control dir.',
|
|
101
|
+
'--watch-ignore [path]': [
|
|
102
|
+
`list of directories watcher should not be tracking for changes. defaults to ['.git', '.hg']`,
|
|
103
|
+
dirs => dirs.split(','),
|
|
104
|
+
],
|
|
105
|
+
'--watch-backend': new commander.Option(
|
|
106
|
+
'--watch-backend <name>',
|
|
107
|
+
'set watcher backend',
|
|
108
|
+
).choices(watcherBackendChoices),
|
|
79
109
|
'--no-source-maps': 'disable sourcemaps',
|
|
80
110
|
'--target [name]': [
|
|
81
111
|
'only build given target(s)',
|
|
@@ -497,10 +527,13 @@ async function normalizeOptions(
|
|
|
497
527
|
if (typeof input !== 'string') return [];
|
|
498
528
|
return input.split(',').map(value => value.trim());
|
|
499
529
|
};
|
|
530
|
+
|
|
500
531
|
return {
|
|
501
532
|
shouldDisableCache: command.cache === false,
|
|
502
533
|
cacheDir: command.cacheDir,
|
|
503
534
|
watchDir: command.watchDir,
|
|
535
|
+
watchBackend: command.watchBackend,
|
|
536
|
+
watchIgnore: command.watchIgnore,
|
|
504
537
|
config: command.config,
|
|
505
538
|
mode,
|
|
506
539
|
hmrOptions,
|