Hi Steven
All our JS modules have “dist” and “lib” folders
- “dist” contains an assembled file for running in the Browser env
- “lib” contains all the library files for running in NodeJS env (loads dependencies in runtime)
So, for building your app you should use “lib” as entry point to avoid any duplicates in the app bundle.
I’m not an expert with Angular and their build system/flow,
but looks like Angular uses files from “dist” directory and then tries to optimize it (only for prod) and as result we have the error.
I think the issue must be fixed somewhere in AngluarDevKit module, but as workaround I can propose you this way:
modify your tsconfig.json file
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
],
"paths": {
"backendless": [
"./node_modules/backendless/lib/index.js"
],
"backendless-rt-client": [
"./node_modules/backendless-rt-client/lib/index.js"
],
"backendless-request": [
"./node_modules/backendless-request/dist/backendless-request.js"
]
}
}
}