Yaz*_*rez 1 webpack angular angular9
我将我的项目升级到 Angular 9。我正在使用 SSR,升级我的webpack.config.js变成webpack.config.js.bak. 现在我正在尝试做ng build --prod && ng run [projectName]:server:production
现在我收到此错误消息
\n\n ERROR in ./node_modules/canvas/build/Release/canvas.node 1:2\n Module parse failed: Unexpected character \'\xef\xbf\xbd\' (1:2)\n You may need an appropriate loader to handle this file type, currently no loaders are configured \n to process this file. See https://webpack.js.org/concepts#loaders\n (Source code omitted for this binary file)\nRun Code Online (Sandbox Code Playgroud)\n\n所以我尝试实现诸如此类的加载器node-loader,我需要知道我是否应该更新我的加载器server.ts,因为我可以看到webpack.config.js在我的情况下不再需要。
编辑:
\n\n我尝试过angular.json但仍然不起作用
"server": {\n "builder": "@angular-devkit/build-angular:server",\n "options": {\n "outputPath": "dist/server",\n "externalDependencies": [\n "fabric"\n ],\n "main": "server.ts",\n "tsConfig": "src/tsconfig.server.json"\n },\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
1240 次 |
| 最近记录: |