我最近下载了Angular CLI(@angular/cli 9.0.1)。然后我继续创建一个新应用程序,以便我可以创建一个新的 Angular 元素,将其打包,然后在另一个应用程序中使用它。
在关注了一些博客之后,我遇到的每个博客的最后一步都在谈论从 dist/ 文件夹下生成的文件创建单个 JS 文件。例如:https : //blog.bitsrc.io/using-angular-elements-why-and-how-part-1-35f7fd4f0457
然后使用cat命令,我们串接runtime.js, polyfills.js,scripts.js中,并main.js从位于dist /角app文件夹的文件到预览文件夹内的文件angularapp.js。
ng build angular-app --prod --output-hashing=none相反,运行似乎会产生名为:
我搜索了每个包含es5和es2015术语的文件并将其更改为es6,但它仍然产生相同的es5和es2015文件名。我在这里做错了什么?
我正在使用VS Code并安装了Remote Development扩展程序。我devcontainer为我的 Angular 应用程序创建了一个。到目前为止,一切正常。该Dockerfile和devcontainer.json文件是非常简单的:
Dockerfile:
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-12
Run Code Online (Sandbox Code Playgroud)
devcontainer.json:
{
"name": "Angular App",
"dockerFile": "Dockerfile",
"settings": {
"git.path": "/usr/bin/git",
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"angular.ng-template",
"natewallace.angular2-inline",
"dbaeumer.vscode-eslint"
],
"forwardPorts": [4200, 9876],
"mounts": [ ],
"remoteEnv": { },
"postCreateCommand": "yarn install",
}
Run Code Online (Sandbox Code Playgroud)
在我的容器之外,我的 git 路径位于C:\Program Files\...目录中。在我的容器中,git 路径是/usr/bin/git,这就是我设置"git.path"属性的原因,我通过使用which git容器内的命令验证了这一点。当然,任何 git 命令都不起作用,因为它们总是会导致错误。
致命:无法 chdir 到“C:/Workspace/my-angular-app”:没有这样的文件或目录
我总是可以使用该Remote-Containers: Reopen Locally命令,一旦我回到 Windows(容器外),我的源代码控制就会亮起我所有的差异,并且 git 工作得很好。但是,如果有办法让 git …