@rollup-extras/plugin-html 1.1.0 → 1.1.1
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/dist/index.cjs +8 -9
- package/dist/index.mjs +8 -9
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -55,7 +55,7 @@ function index (options = {}) {
|
|
|
55
55
|
const instance = {
|
|
56
56
|
name: pluginName,
|
|
57
57
|
renderStart: (options) => {
|
|
58
|
-
logger('started collecting information',
|
|
58
|
+
logger('started collecting information', 0 /* verbose */);
|
|
59
59
|
initialDir = options.dir || '';
|
|
60
60
|
fileNameInInitialDir = path__default["default"].join(initialDir, outputFile);
|
|
61
61
|
return renderStart();
|
|
@@ -97,7 +97,7 @@ function index (options = {}) {
|
|
|
97
97
|
logger('template nor a file or string', 2 /* warn */, e);
|
|
98
98
|
}
|
|
99
99
|
else {
|
|
100
|
-
logger(
|
|
100
|
+
logger('error reading template', 2 /* warn */, e);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
function warnAboutUsingDefaultTemplate() {
|
|
@@ -133,16 +133,16 @@ function index (options = {}) {
|
|
|
133
133
|
.filter(item => item.count)
|
|
134
134
|
.map(({ key, count }) => `${key}: ${count}`)
|
|
135
135
|
.join(', ');
|
|
136
|
-
logger(`assets collected: [${statistics}], remaining: ${remainingOutputsCount} outputs, ${configs.size} configs`,
|
|
136
|
+
logger(`assets collected: [${statistics}], remaining: ${remainingOutputsCount} outputs, ${configs.size} configs`, 0 /* verbose */);
|
|
137
137
|
const dir = options.dir || '', fileName = path__default["default"].relative(dir, fileNameInInitialDir);
|
|
138
138
|
if (fileName in bundle) {
|
|
139
139
|
if (useEmittedTemplate) {
|
|
140
|
-
logger(`using exiting emitted ${fileName} as an input for out templateFactory`,
|
|
140
|
+
logger(`using exiting emitted ${fileName} as an input for out templateFactory`, 0 /* verbose */);
|
|
141
141
|
const source = bundle[fileName].type === 'asset' ? bundle[fileName].source.toString() : bundle[fileName].code;
|
|
142
142
|
useNewTemplate(source);
|
|
143
143
|
}
|
|
144
144
|
else {
|
|
145
|
-
logger(`removing exiting emitted ${fileName}`,
|
|
145
|
+
logger(`removing exiting emitted ${fileName}`, 0 /* verbose */);
|
|
146
146
|
}
|
|
147
147
|
if (configs.size === 0 && emitFile && !useWriteBundle) {
|
|
148
148
|
delete bundle[fileName];
|
|
@@ -154,7 +154,7 @@ function index (options = {}) {
|
|
|
154
154
|
const depromisifiedTemplateString = await templateString, source = await templateFactory(depromisifiedTemplateString, assets, defaultTemplateFactory);
|
|
155
155
|
if (!emitFile || fileName.startsWith('..') || useWriteBundle) {
|
|
156
156
|
if (emitFile && emitFile !== 'auto') {
|
|
157
|
-
logger('cannot emitFile because it is outside of current output.dir, using writeFile instead',
|
|
157
|
+
logger('cannot emitFile because it is outside of current output.dir, using writeFile instead', 0 /* verbose */);
|
|
158
158
|
}
|
|
159
159
|
await fs__default["default"].mkdir(path__default["default"].dirname(fileNameInInitialDir), { recursive: true });
|
|
160
160
|
await fs__default["default"].writeFile(fileNameInInitialDir, source);
|
|
@@ -175,8 +175,7 @@ function index (options = {}) {
|
|
|
175
175
|
logger.finish('html file generated');
|
|
176
176
|
}
|
|
177
177
|
catch (e) {
|
|
178
|
-
logger(
|
|
179
|
-
logger.finish('html generation failed', 3 /* error */);
|
|
178
|
+
logger.finish('html generation failed', 3 /* error */, e);
|
|
180
179
|
}
|
|
181
180
|
}
|
|
182
181
|
}
|
|
@@ -246,7 +245,7 @@ function index (options = {}) {
|
|
|
246
245
|
}
|
|
247
246
|
}
|
|
248
247
|
catch (e) {
|
|
249
|
-
logger(
|
|
248
|
+
logger('exception in assetFactory', 2 /* warn */, e);
|
|
250
249
|
}
|
|
251
250
|
}
|
|
252
251
|
return false;
|
package/dist/index.mjs
CHANGED
|
@@ -47,7 +47,7 @@ function index (options = {}) {
|
|
|
47
47
|
const instance = {
|
|
48
48
|
name: pluginName,
|
|
49
49
|
renderStart: (options) => {
|
|
50
|
-
logger('started collecting information',
|
|
50
|
+
logger('started collecting information', 0 /* verbose */);
|
|
51
51
|
initialDir = options.dir || '';
|
|
52
52
|
fileNameInInitialDir = path.join(initialDir, outputFile);
|
|
53
53
|
return renderStart();
|
|
@@ -89,7 +89,7 @@ function index (options = {}) {
|
|
|
89
89
|
logger('template nor a file or string', 2 /* warn */, e);
|
|
90
90
|
}
|
|
91
91
|
else {
|
|
92
|
-
logger(
|
|
92
|
+
logger('error reading template', 2 /* warn */, e);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
function warnAboutUsingDefaultTemplate() {
|
|
@@ -125,16 +125,16 @@ function index (options = {}) {
|
|
|
125
125
|
.filter(item => item.count)
|
|
126
126
|
.map(({ key, count }) => `${key}: ${count}`)
|
|
127
127
|
.join(', ');
|
|
128
|
-
logger(`assets collected: [${statistics}], remaining: ${remainingOutputsCount} outputs, ${configs.size} configs`,
|
|
128
|
+
logger(`assets collected: [${statistics}], remaining: ${remainingOutputsCount} outputs, ${configs.size} configs`, 0 /* verbose */);
|
|
129
129
|
const dir = options.dir || '', fileName = path.relative(dir, fileNameInInitialDir);
|
|
130
130
|
if (fileName in bundle) {
|
|
131
131
|
if (useEmittedTemplate) {
|
|
132
|
-
logger(`using exiting emitted ${fileName} as an input for out templateFactory`,
|
|
132
|
+
logger(`using exiting emitted ${fileName} as an input for out templateFactory`, 0 /* verbose */);
|
|
133
133
|
const source = bundle[fileName].type === 'asset' ? bundle[fileName].source.toString() : bundle[fileName].code;
|
|
134
134
|
useNewTemplate(source);
|
|
135
135
|
}
|
|
136
136
|
else {
|
|
137
|
-
logger(`removing exiting emitted ${fileName}`,
|
|
137
|
+
logger(`removing exiting emitted ${fileName}`, 0 /* verbose */);
|
|
138
138
|
}
|
|
139
139
|
if (configs.size === 0 && emitFile && !useWriteBundle) {
|
|
140
140
|
delete bundle[fileName];
|
|
@@ -146,7 +146,7 @@ function index (options = {}) {
|
|
|
146
146
|
const depromisifiedTemplateString = await templateString, source = await templateFactory(depromisifiedTemplateString, assets, defaultTemplateFactory);
|
|
147
147
|
if (!emitFile || fileName.startsWith('..') || useWriteBundle) {
|
|
148
148
|
if (emitFile && emitFile !== 'auto') {
|
|
149
|
-
logger('cannot emitFile because it is outside of current output.dir, using writeFile instead',
|
|
149
|
+
logger('cannot emitFile because it is outside of current output.dir, using writeFile instead', 0 /* verbose */);
|
|
150
150
|
}
|
|
151
151
|
await fs.mkdir(path.dirname(fileNameInInitialDir), { recursive: true });
|
|
152
152
|
await fs.writeFile(fileNameInInitialDir, source);
|
|
@@ -167,8 +167,7 @@ function index (options = {}) {
|
|
|
167
167
|
logger.finish('html file generated');
|
|
168
168
|
}
|
|
169
169
|
catch (e) {
|
|
170
|
-
logger(
|
|
171
|
-
logger.finish('html generation failed', 3 /* error */);
|
|
170
|
+
logger.finish('html generation failed', 3 /* error */, e);
|
|
172
171
|
}
|
|
173
172
|
}
|
|
174
173
|
}
|
|
@@ -238,7 +237,7 @@ function index (options = {}) {
|
|
|
238
237
|
}
|
|
239
238
|
}
|
|
240
239
|
catch (e) {
|
|
241
|
-
logger(
|
|
240
|
+
logger('exception in assetFactory', 2 /* warn */, e);
|
|
242
241
|
}
|
|
243
242
|
}
|
|
244
243
|
return false;
|
package/package.json
CHANGED