rollup 2.60.2 → 2.63.0
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/CHANGELOG.md +83 -0
- package/dist/bin/rollup +4 -3
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +879 -779
- package/dist/es/shared/watch.js +6 -6
- package/dist/loadConfigFile.js +3 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.browser.js.map +1 -1
- package/dist/rollup.d.ts +1 -0
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +96 -37
- package/dist/shared/mergeOptions.js +12 -5
- package/dist/shared/rollup.js +879 -778
- package/dist/shared/watch-cli.js +36 -13
- package/dist/shared/watch.js +2 -2
- package/package.json +22 -22
package/dist/rollup.d.ts
CHANGED
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
Tue,
|
|
3
|
+
Rollup.js v2.63.0
|
|
4
|
+
Tue, 04 Jan 2022 07:30:25 GMT - commit ae674c9edde5efb8ce6d8ef845598a805938178c
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
const fs = require('fs');
|
|
14
14
|
const path = require('path');
|
|
15
15
|
const url = require('url');
|
|
16
|
+
const process$1 = require('process');
|
|
16
17
|
const tty = require('tty');
|
|
17
18
|
const rollup = require('./rollup.js');
|
|
18
19
|
const mergeOptions = require('./mergeOptions.js');
|
|
@@ -32,58 +33,116 @@ const fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
|
|
|
32
33
|
const path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
33
34
|
const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
|
|
34
35
|
|
|
35
|
-
const env = process.env;
|
|
36
|
+
const env = process.env || {};
|
|
37
|
+
const argv = process.argv || [];
|
|
36
38
|
|
|
37
|
-
const isDisabled = "NO_COLOR" in env;
|
|
38
|
-
const isForced = "FORCE_COLOR" in env;
|
|
39
|
+
const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
40
|
+
const isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
39
41
|
const isWindows = process.platform === "win32";
|
|
40
42
|
|
|
41
43
|
const isCompatibleTerminal =
|
|
42
|
-
tty__namespace && tty__namespace.isatty(1) && env.TERM && env.TERM !== "dumb";
|
|
44
|
+
tty__namespace && tty__namespace.isatty && tty__namespace.isatty(1) && env.TERM && env.TERM !== "dumb";
|
|
43
45
|
|
|
44
46
|
const isCI =
|
|
45
47
|
"CI" in env &&
|
|
46
48
|
("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
const isColorSupported =
|
|
49
51
|
!isDisabled && (isForced || isWindows || isCompatibleTerminal || isCI);
|
|
50
52
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
const replaceClose = (
|
|
54
|
+
index,
|
|
55
|
+
string,
|
|
56
|
+
close,
|
|
57
|
+
replace,
|
|
58
|
+
head = string.substring(0, index) + replace,
|
|
59
|
+
tail = string.substring(index + close.length),
|
|
60
|
+
next = tail.indexOf(close)
|
|
61
|
+
) => head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
59
62
|
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
)
|
|
63
|
+
const clearBleed = (index, string, open, close, replace) =>
|
|
64
|
+
index < 0
|
|
65
|
+
? open + string + close
|
|
66
|
+
: open + replaceClose(index, string, close, replace) + close;
|
|
67
|
+
|
|
68
|
+
const filterEmpty =
|
|
69
|
+
(open, close, replace = open, at = open.length + 1) =>
|
|
70
|
+
(string) =>
|
|
71
|
+
string || !(string === "" || string === undefined)
|
|
72
|
+
? clearBleed(
|
|
73
|
+
("" + string).indexOf(close, at),
|
|
74
|
+
string,
|
|
75
|
+
open,
|
|
76
|
+
close,
|
|
77
|
+
replace
|
|
78
|
+
)
|
|
79
|
+
: "";
|
|
80
|
+
|
|
81
|
+
const init = (open, close, replace) =>
|
|
82
|
+
filterEmpty(`\x1b[${open}m`, `\x1b[${close}m`, replace);
|
|
83
|
+
|
|
84
|
+
const colors = {
|
|
85
|
+
reset: init(0, 0),
|
|
86
|
+
bold: init(1, 22, "\x1b[22m\x1b[1m"),
|
|
87
|
+
dim: init(2, 22, "\x1b[22m\x1b[2m"),
|
|
88
|
+
italic: init(3, 23),
|
|
89
|
+
underline: init(4, 24),
|
|
90
|
+
inverse: init(7, 27),
|
|
91
|
+
hidden: init(8, 28),
|
|
92
|
+
strikethrough: init(9, 29),
|
|
93
|
+
black: init(30, 39),
|
|
94
|
+
red: init(31, 39),
|
|
95
|
+
green: init(32, 39),
|
|
96
|
+
yellow: init(33, 39),
|
|
97
|
+
blue: init(34, 39),
|
|
98
|
+
magenta: init(35, 39),
|
|
99
|
+
cyan: init(36, 39),
|
|
100
|
+
white: init(37, 39),
|
|
101
|
+
gray: init(90, 39),
|
|
102
|
+
bgBlack: init(40, 49),
|
|
103
|
+
bgRed: init(41, 49),
|
|
104
|
+
bgGreen: init(42, 49),
|
|
105
|
+
bgYellow: init(43, 49),
|
|
106
|
+
bgBlue: init(44, 49),
|
|
107
|
+
bgMagenta: init(45, 49),
|
|
108
|
+
bgCyan: init(46, 49),
|
|
109
|
+
bgWhite: init(47, 49),
|
|
110
|
+
blackBright: init(90, 39),
|
|
111
|
+
redBright: init(91, 39),
|
|
112
|
+
greenBright: init(92, 39),
|
|
113
|
+
yellowBright: init(93, 39),
|
|
114
|
+
blueBright: init(94, 39),
|
|
115
|
+
magentaBright: init(95, 39),
|
|
116
|
+
cyanBright: init(96, 39),
|
|
117
|
+
whiteBright: init(97, 39),
|
|
118
|
+
bgBlackBright: init(100, 49),
|
|
119
|
+
bgRedBright: init(101, 49),
|
|
120
|
+
bgGreenBright: init(102, 49),
|
|
121
|
+
bgYellowBright: init(103, 49),
|
|
122
|
+
bgBlueBright: init(104, 49),
|
|
123
|
+
bgMagentaBright: init(105, 49),
|
|
124
|
+
bgCyanBright: init(106, 49),
|
|
125
|
+
bgWhiteBright: init(107, 49),
|
|
67
126
|
};
|
|
68
127
|
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const gray = init(90, 39);
|
|
128
|
+
const none = (any) => any;
|
|
129
|
+
|
|
130
|
+
const createColors = ({ useColor = isColorSupported } = {}) =>
|
|
131
|
+
useColor
|
|
132
|
+
? colors
|
|
133
|
+
: Object.keys(colors).reduce(
|
|
134
|
+
(colors, key) => ({ ...colors, [key]: none }),
|
|
135
|
+
{}
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
createColors();
|
|
81
139
|
|
|
82
140
|
// @see https://no-color.org
|
|
83
141
|
// @see https://www.npmjs.com/package/chalk
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
142
|
+
const { bold, cyan, dim, gray, green, red, underline, yellow } = createColors({
|
|
143
|
+
useColor: process$1.env.FORCE_COLOR !== '0' && !process$1.env.NO_COLOR
|
|
144
|
+
});
|
|
145
|
+
|
|
87
146
|
// log to stderr to keep `rollup main.js > bundle.js` from breaking
|
|
88
147
|
const stderr = console.error.bind(console);
|
|
89
148
|
function handleError(err, recover = false) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
Tue,
|
|
3
|
+
Rollup.js v2.63.0
|
|
4
|
+
Tue, 04 Jan 2022 07:30:25 GMT - commit ae674c9edde5efb8ce6d8ef845598a805938178c
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -85,7 +85,7 @@ function mergeInputOptions(config, overrides, defaultOnWarnHandler) {
|
|
|
85
85
|
shimMissingExports: getOption('shimMissingExports'),
|
|
86
86
|
strictDeprecations: getOption('strictDeprecations'),
|
|
87
87
|
treeshake: getObjectOption(config, overrides, 'treeshake', rollup.objectifyOptionWithPresets(rollup.treeshakePresets, 'treeshake', 'false, true, ')),
|
|
88
|
-
watch: getWatch(config, overrides
|
|
88
|
+
watch: getWatch(config, overrides)
|
|
89
89
|
};
|
|
90
90
|
rollup.warnUnknownOptions(config, Object.keys(inputOptions), 'input options', inputOptions.onwarn, /^output$/);
|
|
91
91
|
return inputOptions;
|
|
@@ -99,7 +99,7 @@ const getExternal = (config, overrides) => {
|
|
|
99
99
|
const getOnWarn = (config, defaultOnWarnHandler) => config.onwarn
|
|
100
100
|
? warning => config.onwarn(warning, defaultOnWarnHandler)
|
|
101
101
|
: defaultOnWarnHandler;
|
|
102
|
-
const getObjectOption = (config, overrides, name, objectifyValue =
|
|
102
|
+
const getObjectOption = (config, overrides, name, objectifyValue = rollup.objectifyOption) => {
|
|
103
103
|
const commandOption = normalizeObjectOptionValue(overrides[name], objectifyValue);
|
|
104
104
|
const configOption = normalizeObjectOptionValue(config[name], objectifyValue);
|
|
105
105
|
if (commandOption !== undefined) {
|
|
@@ -107,7 +107,13 @@ const getObjectOption = (config, overrides, name, objectifyValue = value => (typ
|
|
|
107
107
|
}
|
|
108
108
|
return configOption;
|
|
109
109
|
};
|
|
110
|
-
const getWatch = (config, overrides
|
|
110
|
+
const getWatch = (config, overrides) => config.watch !== false && getObjectOption(config, overrides, 'watch');
|
|
111
|
+
const isWatchEnabled = (optionValue) => {
|
|
112
|
+
if (Array.isArray(optionValue)) {
|
|
113
|
+
return optionValue.reduce((result, value) => (typeof value === 'boolean' ? value : result), false);
|
|
114
|
+
}
|
|
115
|
+
return optionValue === true;
|
|
116
|
+
};
|
|
111
117
|
const normalizeObjectOptionValue = (optionValue, objectifyValue) => {
|
|
112
118
|
if (!optionValue) {
|
|
113
119
|
return optionValue;
|
|
@@ -168,5 +174,6 @@ function mergeOutputOptions(config, overrides, warn) {
|
|
|
168
174
|
}
|
|
169
175
|
|
|
170
176
|
exports.commandAliases = commandAliases;
|
|
177
|
+
exports.isWatchEnabled = isWatchEnabled;
|
|
171
178
|
exports.mergeOptions = mergeOptions;
|
|
172
179
|
//# sourceMappingURL=mergeOptions.js.map
|