Skip to content

Commit 91a7905

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 b036714 commit 91a7905

1 file changed

Lines changed: 23 additions & 17 deletions

File tree

src/index.js

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -423,27 +423,33 @@ class PowerBICustomVisualsWebpackPlugin {
423423
);
424424

425425
if (this.options.generateResources) {
426-
operations.push(
427-
this.outputFile(
428-
path.join(resourcePath, "visual.js"),
429-
config.content.js,
430-
),
431-
this.outputFile(
426+
if (config.content.js != null) {
427+
operations.push(
428+
this.outputFile(
429+
path.join(resourcePath, "visual.js"),
430+
config.content.js
431+
)
432+
);
433+
operations.push(this.outputFile(
434+
path.join(resourcePath, "visual.prod.js"),
435+
config.content.js
436+
));
437+
}
438+
if (prodConfig != null) {
439+
operations.push(this.outputFile(
432440
path.join(
433441
resourcePath,
434-
`${prodConfig.visual.guid}.pbiviz.json`,
442+
`${prodConfig.visual.guid}.pbiviz.json`
435443
),
436-
JSON.stringify(prodConfig),
437-
),
438-
this.outputFile(
439-
path.join(resourcePath, "visual.prod.js"),
440-
config.content.js,
441-
),
442-
this.outputFile(
444+
JSON.stringify(prodConfig)
445+
));
446+
}
447+
if (config.content.css != null) {
448+
operations.push(this.outputFile(
443449
path.join(resourcePath, "visual.prod.css"),
444-
config.content.css,
445-
),
446-
);
450+
config.content.css
451+
));
452+
}
447453
}
448454

449455
if (this.options.generatePbiviz) {

0 commit comments

Comments
 (0)