-
Notifications
You must be signed in to change notification settings - Fork 0
Support publishing sourcemaps #1
Copy link
Copy link
Open
Description
We want to be able to effectively debug PCFs in production without including in-line sourcemap. So the sourcemap should be included with the solution even in production build (it doesn't get loaded in the browser unless F12 Developer Tools are open).
- Provide custom
webpack.config.base.js(sort of a template file) which can be referenced in control's own (based on this for example) -
Ensure that the the sourcemap is generated for production builds - Development builds should use inline sourcemap (so it's easier to load with Fiddler)
-
Ensure the sourcemap is included in the solution- It doesn't get included in the solution unless specified in
ControlManifest.xml(it's ignored). The only viable way is to specify it ashtmlwhich is not supported in canvas - This has to however be done post
pcf-scripts build/rebuildbecause build outputs are copied toout/based on manifest, andbundle.js.mapgets outputted there directly from webpack
- It doesn't get included in the solution unless specified in
- Ensure the sourcemap is used when loaded in Power Apps in the browser
- Document this process into README
-
Ensure our metadata service (INT0014) can provide the sourcemaps via/webresource/*endpoint
The created webpack.config.base.js should look like this. getBuildMode should be also exported.
export const getBuildMode = () => {
const cliArgs = process.argv;
const indexOfMode = cliArgs.findIndex(x => x.includes("--buildMode"));
return cliArgs[indexOfMode + 1].replaceAll("\"", "");
};
export const extendWebpackConfig = (customConfig) => {
customConfig.devtool = getBuildMode() === "production" ? "source-map" : "inline-source-map";
};The consumer should be able to use it in their webpack.config.js following way:
import { extendWebpackConfig } from "@talxis/pcf-preset-base/webpack.config.base.js`;
const customConfig = {};
extendWebpackConfig(customConfig);
module.exports = customConfig;There is an issue with shipping sourcemaps, since all the PCF use the same namespace pcf_tools_652ac3f36e1e4bca82eb3c1dc44e6fad which can result in conflicting dependency names.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels