constructor()

in index.js [41:101]


	constructor(options) {
		const name = "SampleVisual";
		const apiVersion = "1.10.0";
		const defaultOptions = {
			visual: {
				name: name,
				displayName: name,
				guid: `${name}_${new Date().getTime()}_${Math.random()
					.toString()
					.substr(2)}`,
				visualClassName: "Visual",
				version: "1.0.0.0",
				description: "",
				supportUrl: "",
				gitHubUrl: "",
			},
			author: "",
			apiVersion: apiVersion,
			stringResourcesPath: {
				"en-US": {},
			},
			capabilities: {},
			iconImage: !options.assets.icon
				? base64Img(path.join(__dirname, "templates", "icon.png"))
				: base64Img(path.join(process.cwd(), options.assets.icon)),
			devMode: true,
			packageOutPath: path.join(process.cwd(), "dist"),
			cssStyles: null,
			generateResources: true,
			generatePbiviz: true,
			generatePlugin: true,
			minifyJS: true,
			schemaLocation: path.join(process.cwd(), ".api", "v" + apiVersion),
			capabilitiesSchema: null,
			pbivizSchema: null,
			stringResourcesSchema: null,
			dependenciesSchema: null,
			modules: true,
			visualSourceLocation: "",
			pluginLocation: path.join(".tmp", "precompile", "visualPlugin.ts"),
			compression: 0, // no compression,
			env: null,
		};

		this.needAditionalRun = false;
		this.additionalAssets = {
			jsFile: null,
			pbivizJSON: null,
			status: null,
		};
		this._name = "PowerBICustomVisualsWebpackPlugin";
		this.options = Object.assign(defaultOptions, options);
		this.options.pluginLocation = path.normalize(
			this.options.pluginLocation
		);
		this.options.schemaLocation = path.join(
			process.cwd(),
			".api",
			"v" + this.options.apiVersion
		);
	}