powerbi-visuals-tools 6.2.0 → 7.0.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.
Files changed (48) hide show
  1. package/.eslintrc.json +21 -0
  2. package/Changelog.md +5 -0
  3. package/eslint.config.mjs +37 -0
  4. package/package.json +1 -24
  5. package/certs/blank +0 -0
  6. package/lib/CertificateTools.js +0 -262
  7. package/lib/CommandManager.js +0 -75
  8. package/lib/ConsoleWriter.js +0 -188
  9. package/lib/FeatureManager.js +0 -43
  10. package/lib/LintValidator.js +0 -61
  11. package/lib/Package.js +0 -46
  12. package/lib/TemplateFetcher.js +0 -111
  13. package/lib/Visual.js +0 -29
  14. package/lib/VisualGenerator.js +0 -221
  15. package/lib/VisualManager.js +0 -316
  16. package/lib/WebPackWrap.js +0 -274
  17. package/lib/features/APIVersion.js +0 -16
  18. package/lib/features/AdvancedEditMode.js +0 -12
  19. package/lib/features/AllowInteractions.js +0 -12
  20. package/lib/features/AnalyticsPane.js +0 -17
  21. package/lib/features/BaseFeature.js +0 -9
  22. package/lib/features/Bookmarks.js +0 -12
  23. package/lib/features/ColorPalette.js +0 -12
  24. package/lib/features/ConditionalFormatting.js +0 -12
  25. package/lib/features/ContextMenu.js +0 -12
  26. package/lib/features/DrillDown.js +0 -16
  27. package/lib/features/FeatureTypes.js +0 -23
  28. package/lib/features/FetchMoreData.js +0 -22
  29. package/lib/features/FileDownload.js +0 -12
  30. package/lib/features/FormatPane.js +0 -12
  31. package/lib/features/HighContrast.js +0 -12
  32. package/lib/features/HighlightData.js +0 -12
  33. package/lib/features/KeyboardNavigation.js +0 -12
  34. package/lib/features/LandingPage.js +0 -12
  35. package/lib/features/LaunchURL.js +0 -12
  36. package/lib/features/LocalStorage.js +0 -12
  37. package/lib/features/Localizations.js +0 -12
  38. package/lib/features/ModalDialog.js +0 -12
  39. package/lib/features/RenderingEvents.js +0 -13
  40. package/lib/features/SelectionAcrossVisuals.js +0 -12
  41. package/lib/features/SyncSlicer.js +0 -12
  42. package/lib/features/Tooltips.js +0 -12
  43. package/lib/features/TotalSubTotal.js +0 -12
  44. package/lib/features/VisualVersion.js +0 -12
  45. package/lib/features/WarningIcon.js +0 -12
  46. package/lib/features/index.js +0 -28
  47. package/lib/utils.js +0 -43
  48. package/lib/webpack.config.js +0 -148
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class ColorPalette {
3
- static featureName = "Color Palette";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/add-colors-power-bi-visual";
5
- static severity = Severity.Warning;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.contain(".colorPalette");
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class ConditionalFormatting {
3
- static featureName = "Conditional Formatting";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/conditional-format";
5
- static severity = Severity.Info;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.contain(".createDataViewWildcardSelector");
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class ContextMenu {
3
- static featureName = "Context Menu";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/context-menu";
5
- static severity = Severity.Warning;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.contain(".showContextMenu");
11
- }
12
- }
@@ -1,16 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class DrillDown {
3
- static featureName = "Drill Down";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/drill-down-support";
5
- static severity = Severity.Info;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.isCapabilityEnabled({
11
- drilldown: {
12
- roles: []
13
- }
14
- });
15
- }
16
- }
@@ -1,23 +0,0 @@
1
- export var Severity;
2
- (function (Severity) {
3
- Severity["Error"] = "error";
4
- Severity["Deprecation"] = "deprecation";
5
- Severity["Warning"] = "warning";
6
- Severity["Info"] = "info";
7
- })(Severity || (Severity = {}));
8
- export var Stage;
9
- (function (Stage) {
10
- Stage["PreBuild"] = "pre-build";
11
- Stage["PostBuild"] = "post-build";
12
- })(Stage || (Stage = {}));
13
- export var VisualFeatureType;
14
- (function (VisualFeatureType) {
15
- VisualFeatureType[VisualFeatureType["NonSlicer"] = 2] = "NonSlicer";
16
- VisualFeatureType[VisualFeatureType["Slicer"] = 4] = "Slicer";
17
- VisualFeatureType[VisualFeatureType["Matrix"] = 8] = "Matrix";
18
- VisualFeatureType[VisualFeatureType["All"] = 14] = "All";
19
- })(VisualFeatureType || (VisualFeatureType = {}));
20
- // Interaction types: Selection or filter (slicer)
21
- // Slicer type: Basic, Advanced, Tuple filter, Identity filter
22
- // Visual Type: TS/JS or R-Visual or RHTML
23
- // Dataview Type: Single or Matrix or Table or Category or All
@@ -1,22 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class FetchMoreData {
3
- static featureName = "Fetch More Data";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/fetch-more-data";
5
- static severity = Severity.Info;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.isCapabilityEnabled({
11
- dataViewMappings: [
12
- {
13
- table: {
14
- rows: {
15
- dataReductionAlgorithm: {}
16
- }
17
- }
18
- }
19
- ]
20
- });
21
- }
22
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class FileDownload {
3
- static featureName = "File Download";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/file-download-api";
5
- static severity = Severity.Info;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.contain(".downloadService") && packageInstance.contain(".exportVisualsContent");
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class FormatPane {
3
- static featureName = "Format Pane";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/format-pane";
5
- static severity = Severity.Deprecation;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.All;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.contain("getFormattingModel");
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class HighContrast {
3
- static featureName = "High Contrast";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/high-contrast-support";
5
- static severity = Severity.Warning;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.contain(".isHighContrast");
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class HighlightData {
3
- static featureName = "Highlight Data";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/highlight";
5
- static severity = Severity.Warning;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.isCapabilityEnabled({ supportsHighlight: true });
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class KeyboardNavigation {
3
- static featureName = "Keyboard Navigation";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/supportskeyboardfocus-feature";
5
- static severity = Severity.Warning;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.isCapabilityEnabled({ supportsKeyboardFocus: true });
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class LandingPage {
3
- static featureName = "Landing Page";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/landing-page";
5
- static severity = Severity.Warning;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.isCapabilityEnabled({ supportsLandingPage: true });
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class LaunchURL {
3
- static featureName = "Launch URL";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/launch-url";
5
- static severity = Severity.Info;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.contain(".launchUrl");
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class LocalStorage {
3
- static featureName = "Local Storage";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/local-storage";
5
- static severity = Severity.Info;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.contain(".storageService");
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class Localizations {
3
- static featureName = "Localizations";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/localization";
5
- static severity = Severity.Warning;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.contain(".createLocalizationManager");
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class ModalDialog {
3
- static featureName = "Modal Dialog";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/create-display-dialog-box";
5
- static severity = Severity.Info;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.contain(".openModalDialog");
11
- }
12
- }
@@ -1,13 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class RenderingEvents {
3
- static featureName = "Rendering Events";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/event-service";
5
- static severity = Severity.Warning;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.All;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- const keywords = [".eventService", ".renderingStarted", ".renderingFinished"];
11
- return !keywords.some(keyword => !packageInstance.contain(keyword));
12
- }
13
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class SelectionAcrossVisuals {
3
- static featureName = "Selection Across Visuals";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/supportsmultivisualselection-feature";
5
- static severity = Severity.Warning;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.isCapabilityEnabled({ supportsMultiVisualSelection: true });
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class SyncSlicer {
3
- static featureName = "Sync Slicer";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/enable-sync-slicers";
5
- static severity = Severity.Warning;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.isCapabilityEnabled({ supportsSynchronizingFilterState: true });
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class Tooltips {
3
- static featureName = "Tooltips";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/add-tooltips";
5
- static severity = Severity.Warning;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.contain("tooltipService") && packageInstance.isCapabilityEnabled({ tooltips: {} });
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class TotalSubTotal {
3
- static featureName = "Total SubTotal";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/total-subtotal-api";
5
- static severity = Severity.Warning;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.Matrix;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.isCapabilityEnabled({ subtotals: {} });
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class VisualVersion {
3
- static featureName = "Visual version";
4
- static expectedVersionLength = 4;
5
- static errorMessage = `${this.featureName} should consist of ${this.expectedVersionLength} parts. Update the pbiviz.json file`;
6
- static severity = Severity.Error;
7
- static stage = Stage.PreBuild;
8
- static visualFeatureType = VisualFeatureType.All;
9
- static isSupported(visual) {
10
- return visual.isVisualVersionValid(this.expectedVersionLength);
11
- }
12
- }
@@ -1,12 +0,0 @@
1
- import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
- export default class WarningIcon {
3
- static featureName = "Warning Icon";
4
- static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/visual-display-warning-icon";
5
- static severity = Severity.Info;
6
- static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
- static errorMessage = `${this.featureName} - ${this.documentationLink}`;
9
- static isSupported(packageInstance) {
10
- return packageInstance.contain(".displayWarningIcon");
11
- }
12
- }
@@ -1,28 +0,0 @@
1
- import AdvancedEditMode from './AdvancedEditMode.js';
2
- import AllowInteractions from './AllowInteractions.js';
3
- import AnalyticsPane from './AnalyticsPane.js';
4
- import Bookmarks from './Bookmarks.js';
5
- import ColorPalette from './ColorPalette.js';
6
- import ConditionalFormatting from './ConditionalFormatting.js';
7
- import ContextMenu from './ContextMenu.js';
8
- import DrillDown from './DrillDown.js';
9
- import FetchMoreData from './FetchMoreData.js';
10
- import FileDownload from './FileDownload.js';
11
- import FormatPane from './FormatPane.js';
12
- import HighContrast from './HighContrast.js';
13
- import HighlightData from './HighlightData.js';
14
- import KeyboardNavigation from './KeyboardNavigation.js';
15
- import LandingPage from './LandingPage.js';
16
- import LaunchURL from './LaunchURL.js';
17
- import Localizations from './Localizations.js';
18
- import LocalStorage from './LocalStorage.js';
19
- import ModalDialog from './ModalDialog.js';
20
- import RenderingEvents from './RenderingEvents.js';
21
- import SelectionAcrossVisuals from './SelectionAcrossVisuals.js';
22
- import SyncSlicer from './SyncSlicer.js';
23
- import Tooltips from './Tooltips.js';
24
- import TotalSubTotal from './TotalSubTotal.js';
25
- import WarningIcon from './WarningIcon.js';
26
- import APIVersion from './APIVersion.js';
27
- import VisualVersion from './VisualVersion.js';
28
- export { AdvancedEditMode, AllowInteractions, AnalyticsPane, Bookmarks, ColorPalette, ConditionalFormatting, ContextMenu, DrillDown, FetchMoreData, FileDownload, FormatPane, HighContrast, HighlightData, KeyboardNavigation, LandingPage, LaunchURL, Localizations, LocalStorage, ModalDialog, RenderingEvents, SelectionAcrossVisuals, SyncSlicer, Tooltips, TotalSubTotal, WarningIcon, APIVersion, VisualVersion };
package/lib/utils.js DELETED
@@ -1,43 +0,0 @@
1
- import fs from 'fs-extra';
2
- import https from "https";
3
- import path from "path";
4
- import { fileURLToPath } from 'node:url';
5
- export function download(url, pathToFile) {
6
- return new Promise((resolve, reject) => {
7
- const fileStream = fs.createWriteStream(pathToFile);
8
- https.get(url, (res) => {
9
- res.pipe(fileStream);
10
- fileStream.on('close', () => resolve(fileStream));
11
- res.on('error', (error) => reject(error));
12
- })
13
- .on('error', (error) => reject(error));
14
- });
15
- }
16
- export function createFolder(folderName) {
17
- const folder = path.join("./", folderName);
18
- fs.ensureDirSync(folder);
19
- return folder;
20
- }
21
- export function getRootPath() {
22
- const pathToDirectory = fileURLToPath(import.meta.url);
23
- return path.join(pathToDirectory, "..", "..");
24
- }
25
- export function getJsPath(filePath) {
26
- return filePath.replace(/\.json$/, '.mjs');
27
- }
28
- async function safelyImport(filePath) {
29
- return fs.existsSync(filePath) && (await import(`file://${filePath}`)).default;
30
- }
31
- function safelyParse(filePath) {
32
- return fs.existsSync(filePath) && JSON.parse(fs.readFileSync(filePath, "utf-8"));
33
- }
34
- export async function readJsonFromRoot(jsonFilename) {
35
- const jsonPath = path.join(getRootPath(), jsonFilename);
36
- const jsPath = getJsPath(jsonPath);
37
- return (await safelyImport(jsPath)) || safelyParse(jsonPath);
38
- }
39
- export async function readJsonFromVisual(filePath, visualPath) {
40
- const jsonPath = path.join(visualPath ?? process.cwd(), filePath);
41
- const jsPath = getJsPath(jsonPath);
42
- return (await safelyImport(jsPath)) || safelyParse(jsonPath);
43
- }
@@ -1,148 +0,0 @@
1
- import { getRootPath, readJsonFromRoot } from './utils.js';
2
- import MiniCssExtractPlugin from "mini-css-extract-plugin";
3
- import TerserPlugin from "terser-webpack-plugin";
4
- import path from "path";
5
- import webpack from "webpack";
6
- const config = await readJsonFromRoot("/config.json");
7
- const rootPath = getRootPath();
8
- const webpackConfig = {
9
- entry: {
10
- 'visual.js': ['./src/visual.ts']
11
- },
12
- target: 'web',
13
- node: false,
14
- devtool: false,
15
- mode: "production",
16
- optimization: {
17
- minimizer: [
18
- new TerserPlugin({
19
- parallel: true,
20
- terserOptions: {}
21
- })
22
- ],
23
- minimize: false,
24
- concatenateModules: false
25
- },
26
- performance: {
27
- maxEntrypointSize: 1024000,
28
- maxAssetSize: 1024000,
29
- hints: false
30
- },
31
- module: {
32
- rules: [
33
- {
34
- parser: {
35
- amd: false
36
- }
37
- },
38
- {
39
- test: /\.m?js/,
40
- resolve: {
41
- fullySpecified: false
42
- }
43
- },
44
- {
45
- test: /\.json$/,
46
- loader: "json-loader",
47
- type: "javascript/auto"
48
- },
49
- {
50
- test: /(\.less)|(\.css)$/,
51
- use: [
52
- {
53
- loader: MiniCssExtractPlugin.loader
54
- },
55
- {
56
- loader: "css-loader"
57
- },
58
- {
59
- loader: "less-loader",
60
- options: {
61
- lessOptions: {
62
- paths: [path.resolve(rootPath, 'node_modules')]
63
- }
64
- }
65
- }
66
- ]
67
- },
68
- {
69
- test: /\.(woff|ttf|ico|woff2|jpg|jpeg|png|webp|gif|svg|eot)$/i,
70
- type: 'asset/inline'
71
- }
72
- ]
73
- },
74
- resolveLoader: {
75
- modules: ['node_modules', path.resolve(rootPath, 'node_modules')],
76
- },
77
- externals: {
78
- "powerbi-visuals-api": 'null'
79
- },
80
- resolve: {
81
- symlinks: false,
82
- extensions: ['.tsx', '.ts', '.jsx', '.js', '.mjs', '.css'],
83
- modules: ['node_modules', path.resolve(rootPath, 'node_modules')],
84
- fallback: {
85
- assert: "assert",
86
- buffer: "buffer",
87
- console: "console-browserify",
88
- constants: "constants-browserify",
89
- crypto: "crypto-browserify",
90
- domain: "domain-browser",
91
- events: "events",
92
- http: "stream-http",
93
- https: "https-browserify",
94
- os: "os-browserify",
95
- path: "path-browserify",
96
- punycode: "punycode",
97
- process: "process",
98
- querystring: "querystring-es3",
99
- stream: "stream-browserify",
100
- _stream_duplex: "readable-stream",
101
- _stream_passthrough: "readable-stream",
102
- _stream_readable: "readable-stream",
103
- _stream_transform: "readable-stream",
104
- _stream_writable: "readable-stream",
105
- string_decoder: "string_decoder",
106
- sys: "util",
107
- timers: "timers-browserify",
108
- tty: "tty-browserify",
109
- url: "url",
110
- util: "util",
111
- vm: "vm-browserify",
112
- zlib: "browserify-zlib"
113
- }
114
- },
115
- output: {
116
- path: null,
117
- publicPath: 'assets',
118
- filename: "[name]"
119
- },
120
- devServer: {
121
- allowedHosts: "all",
122
- static: {
123
- directory: null
124
- },
125
- compress: true,
126
- port: 8080,
127
- hot: false,
128
- server: 'https',
129
- headers: {
130
- "access-control-allow-origin": "*",
131
- "cache-control": "public, max-age=0"
132
- }
133
- },
134
- watchOptions: {
135
- ignored: ['node_modules/**']
136
- },
137
- plugins: [
138
- new webpack.ProvidePlugin({
139
- Buffer: ["buffer", "Buffer"],
140
- process: "process/browser"
141
- }),
142
- new MiniCssExtractPlugin({
143
- filename: config.build.css,
144
- chunkFilename: "[id].css"
145
- })
146
- ]
147
- };
148
- export default webpackConfig;