Skip to content

Commit 29ad72e

Browse files
committed
update
1 parent bcac820 commit 29ad72e

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44

55
## Overview
66

7-
This project aims to integrate a core module into a Lightning Web Component (LWC) in Salesforce. The core module is successfully being loaded as a static resource. However, due to an error regarding the absence of the __dirname variable, a node-specific variable.
8-
9-
Error:
10-
`Failed to load script at /resource/1715776405000/lfs: __dirname is not defined [__dirname is not defined]
11-
`
12-
13-
This error is related to [webpack Issue #14072](https://github.com/webpack/webpack/issues/14072), which discusses the necessity for webpack to support free __filename and __dirname references in CommonJS files when building an ECMAScript Module (ESM) build. The feature request aims to address compatibility issues encountered in projects using dependencies that are still in the CommonJS format.
7+
This project aims to integrate a core module into a Lightning Web Component (LWC) in Salesforce. The core module is successfully being loaded as a static resource, although it seemingly required several changes on the core module. We are currently able to show the rules.
148

159
## Core Module
1610

@@ -20,8 +14,10 @@ The core module is loaded as a single JavaScript file static resource. The JavaS
2014

2115
`cd lightning-flow-scanner-core`
2216

23-
`ncc build ./dist/index.js -o <outputdir>` or `npx rollup -i out/index.js -o dist/bundle.js -f iife`
17+
`git checkout toolingapi`
18+
19+
`npx rollup -c rollup.config.js`
2420

2521
## Development Status
2622

27-
Despite the current error, this project demonstrates promising progress towards realizing a Lightning Web Component. Further testing and adjustments are required and future iterations may involve creating a version of the core module that is not based on CommonJS files.
23+
Despite the current state, this project demonstrates promising progress towards realizing a Lightning Web Component.

force-app/main/default/lwc/lightningFlowScanner/lightningFlowScanner.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export default class MyComponent extends LightningElement {
1010
try {
1111
// Load Lightning Flow Scanner from the static resource URL
1212
loadScript(this, lfs).then(() => {
13-
let currentTime = lightningflowscanner.getRules();
13+
let rules = lightningflowscanner.getRules();
14+
for (let rule of rules){
15+
console.log(rule.name);
16+
}
1417
});
1518

1619

0 commit comments

Comments
 (0)