1, 安装 webpack, 要在你自己的项目工程目录下,(在 cmd 环境下) 执行以下命令:
结果会产生一个 node_modules 文件夹, 下面有 N 多目录和文件.
(npm init) 初始化项目后, 当前目录下, 会生成 package.json 配置文件.
- npm install webpack --save-dev
- ...
- npm install
2,webpack 打包
在 webpack.config.js 输出对象中的 devServer 属性中写配置
写在 package.json 中, 写在 node 命令对应的脚本中, 例如我们可以写成:
- "scripts": {
- "start": "node_modules/.bin/webpack-dev-server ...."
- }
文件 tsconfig.json 中 :
"experimentaldesorators":true
3 个配置文件
乱!
2, 安装一个 cli
D:\Program Files (x86)\WebFrontEnd\ng_cli>npm install --global @angular/cli@latest
C:\Users\OldEric\AppData\Roaming\npm\ng -> C:\Users\OldEric\AppData\Roaming\npm\
node_modules\@angular\cli\bin\ng
> @angular/cli@6.0.8 postinstall C:\Users\OldEric\AppData\Roaming\npm\node_modul
- es\@angular\cli
- > node ./bin/ng-update-message.js
- npm WARN rollback Rolling back node-pre-gyp@0.10.0 failed (this is probably harm
less): EPERM: operation not permitted, lstat 'C:\Users\OldEric\AppData\Roaming\n
- pm\node_modules\@angular\cli\node_modules\fsevents\node_modules'
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\@an
- gular\cli\node_modules\fsevents):
- npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
- 1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
- )
- + @angular/cli@6.0.8
- updated 1 package in 23.182s
Angular cli 帮你干了以下这么多事情:
创建 helloKeriy 目录
应用程序相关的源文件和目录将会被创建
应用程序的所有依赖 (package.json 中配置的依赖项) 将会被自动安装
自动配置项目中的 TypeScript 开发环境
自动配置 Karma 单元测试环境
自动配置 Protractor (end-to-end) 测试环境
创建 environment 相关的文件并初始化为默认的设置
3, 安装 git.
安装后, 记得要配置名字和邮箱.
*** Please tell me who you are.
- Run
- git config --global user.email "you@example.com"
- git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
- fatal: unable to auto-detect email address (got 'OldEric@OldEric-PC.(none)')
- E:\WebstormProjects\AngularProj>git config --global user.name "olderic"
- E:\WebstormProjects\AngularProj>git config --global user.email "491391366@qq.com"
来源: https://www.2cto.com/kf/201806/755879.html