我在将项目从 Angular 8.2.1 升级到 Angular 13 版本时遇到问题。
在准备构建时成功升级后,出现以下错误。
Data path "" must NOT have additional properties(extractCss).
Run Code Online (Sandbox Code Playgroud)
我已经在 angular.json 文件中重命名为styleext with style,但仍然无法找到此错误的根本原因。
angular.json 文件如下。
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"qiwkCollaborator": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
/* "configurations": {
"fr": {
"aot": true,
"outputPath": "dist/qwikCollaborator/fr/",
"i18nFile": "src/translate/messages.fr.xlf",
"i18nFormat": "xlf",
"i18nLocale": "fr",
"i18nMissingTranslation": "error"
},
"en": {
"aot": true,
"outputPath": "dist/qwikCollaborator/en/", …Run Code Online (Sandbox Code Playgroud) 您好 在 Angular 8 中创建了一个项目。最初它只支持一种默认语言(US-EN)。然后我应用了本地化。
在准备生产构建的本地化之前,我曾经给出以下命令。
ng build --prod --base-href "/Windchill/com/qiwkCollaborator/"
Run Code Online (Sandbox Code Playgroud)
本地化后,我在 angular.json 和 package.json 中做了一些更改。在进行这些更改后,每当我发出任何准备构建它的命令时,都会出现以下错误。
An unhandled exception occurred: Configuration 'production' is not set in the workspace.
Run Code Online (Sandbox Code Playgroud)
Package.json 文件的某些部分如下:
"name": "qwik-collaborator",
"version": "1.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"build-locale:en": "ng build --prod --i18n-locale en --i18n-format xlf --i18n-file src/translate/messages.en.xlf --output-path=dist/en --baseHref /en/",
"build-locale:fr": "ng build --prod --i18n-locale fr --i18n-format xlf --i18n-file src/translate/messages.fr.xlf --output-path=dist/fr --baseHref /fr/"
Run Code Online (Sandbox Code Playgroud)
Angular.json …