Skip to content

Commit 68bc8df

Browse files
committed
Suppressing error: error The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
1 parent b8b5fa7 commit 68bc8df

1 file changed

Lines changed: 19 additions & 13 deletions

File tree

src/index.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -407,27 +407,33 @@ class PowerBICustomVisualsWebpackPlugin {
407407
);
408408

409409
if (this.options.generateResources) {
410-
operations.push(
411-
this.outputFile(
412-
path.join(resourcePath, "visual.js"),
410+
if (config.content.js != null) {
411+
operations.push(
412+
this.outputFile(
413+
path.join(resourcePath, "visual.js"),
414+
config.content.js
415+
)
416+
);
417+
operations.push(this.outputFile(
418+
path.join(resourcePath, "visual.prod.js"),
413419
config.content.js
414-
),
415-
this.outputFile(
420+
));
421+
}
422+
if (prodConfig != null) {
423+
operations.push(this.outputFile(
416424
path.join(
417425
resourcePath,
418426
`${prodConfig.visual.guid}.pbiviz.json`
419427
),
420428
JSON.stringify(prodConfig)
421-
),
422-
this.outputFile(
423-
path.join(resourcePath, "visual.prod.js"),
424-
config.content.js
425-
),
426-
this.outputFile(
429+
));
430+
}
431+
if (config.content.css != null) {
432+
operations.push(this.outputFile(
427433
path.join(resourcePath, "visual.prod.css"),
428434
config.content.css
429-
)
430-
);
435+
));
436+
}
431437
}
432438

433439
if (this.options.generatePbiviz) {

0 commit comments

Comments
 (0)