I have application (a) and 2 plugins (p1 and p2). In P2's db folder i created a file x.cds that contains an extension
extend entity domaind.Bla with {
...additional fields
}
using from '[p2 package name]
Request clarification before answering.
To expose CDS files from a plugin, it needs to be added to `cds.env.roots` for CDS to resolve `*.cds` file from non project path.
const cds = require("@sap/cds");
// add this plugin's root to cds.env.roots
// cds find the `index.cds` file to be loaded into CDS model and available for any DB or tenancy approach
const root = __dirname; // or path.join(__dirname, "db") - if you have a custom folder with `index.cds`
if (!cds.env.roots.includes(root)) cds.env.roots.push(root);
​{
...
"exports": {
...
"./cds-plugin": "./cds-plugin.js"
},
...
}​
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.