我根据this文章(在wiki angular-cli上发表的一篇文章)使用了角度通用。所有步骤都正常,但在最后一步(npm run serve:ssr)下面的错误显示:
打包后,加载页面会出现这种情况:
未捕获的ReferenceError:未定义webpackJsonp 在vendor.0d1ec0a758.js:1 未捕获的ReferenceError:未定义webpackJsonp 在app.ec87183347.js:1
我使用angular 4.0.0,这行是我的package.json:
{
"name": "roxo",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"build:ssr": "npm run build:client-and-server-bundles && npm run webpack:server",
"serve:ssr": "node dist/server.js",
"build:client-and-server-bundles": "ng build --prod -a home && ng build --prod -a server --output-hashing=false",
"webpack:server": "webpack --config webpack.server.config.js --display-entrypoints --progress --colors"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/platform-server": "^4.0.0",
"@angular/router": "^4.0.0",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.4",
"@nguniversal/module-map-ngfactory-loader": "^1.0.0-beta.3",
"angular2-persian-pipes": "0.0.6",
"bootstrap.native": "^2.0.19",
"core-js": "^2.4.1",
"enhanced-resolve": "^3.3.0",
"hammerjs": "^2.0.8",
"jalali-moment": "^2.1.3",
"jquery": "^2.2.4",
"lg-autoplay": "^1.0.4",
"lg-fullscreen": "^1.0.1",
"lg-hash": "^1.0.4",
"lg-pager": "^1.0.2",
"lg-share": "^1.1.0",
"lg-thumbnail": "^1.1.0",
"lg-video": "^1.2.0",
"lg-zoom": "^1.1.0",
"lightgallery": "^1.6.6",
"ng-recaptcha": "^3.0.3",
"ng-spin-kit": "^5.1.1",
"ng2-carouselamos": "^3.2.0",
"ng2-ckeditor": "^1.1.9",
"ng2-jalali-date-picker": "^2.0.3",
"ng2-typewriter": "^1.1.0",
"ng2-validation": "^4.2.0",
"ngx-bootstrap": "^1.9.3",
"ngx-carousel": "^1.3.3",
"ngx-pagination": "^3.0.1",
"ngx-toastr": "^6.2.1",
"primeng": "^4.2.1",
"rxjs": "^5.1.0",
"ts-loader": "^3.5.0",
"zone.js": "^0.8.20"
},
"devDependencies": {
"@angular/cli": "1.7.3",
"@angular/compiler-cli": "^4.0.0",
"@angular/language-service": "^4.0.0",
"@types/core-js": "^0.9.46",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/jquery": "^3.2.16",
"@types/node": "~6.0.60",
"codelyzer": "~3.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"persian-date": "^1.0.1",
"primeng": "^4.2.2",
"protractor": "~5.1.2",
"ts-node": "~5.0.1",
"tslint": "~5.3.2",
"typescript": "~2.7.1",
"video.js": "^6.6.3"
}
}
有人可以帮我解决上述问题吗?