从 Angular 15 升级到 16 后,./src/main.ts 和 ./src/polyfills.ts 出现相同的错误:模块构建失败(来自 ./node_modules/@ngtools/webpack/src/ivy/index.js ):错误:无法将类型实体 i29.DragAndDropModule 解析为符号。
解决方案包含设置“preserveSymlinks”:true
{
"name": "xxxxx-web",
"version": "0.0.312",
"build": {
"appId": "com.electon.xxxxx-Web",
"main": "main.js",
"productName": "xxxxx-Web",
"files": [
"main.js",
"dist/xxxxx-web"
],
"win": {
"icon": "./img/icon.ico",
"target": "msi"
}
},
"scripts": {
"ng": "ng",
"start": "ng serve",
"prebuild": "npm --no-git-tag-version version patch",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"electron": "ng build --base-href ./ && electron .",
"electron-build": "ng …Run Code Online (Sandbox Code Playgroud)