我喜欢Ionic自己跟随他们的example apps的布局:
resources/
src/
www/
.editorconfig
.gitignore
config.xml
ionic.config.json
package.json
tsconfig.json
tslint.json
这消除了node_modules
的混乱,可以用npm install
和platform
和plugins
目录重建,也可以重建。
如果你想要遵循这个布局,你的.gitignore
可能如下所示:
.sass-cache/
.tmp/
.versions/
coverage/
dist/
node_modules/
tmp/
temp/
hooks/
platforms/
plugins/
plugins/android.json
plugins/ios.json
在新的项目文件夹中执行“npm install”时,我也收到此消息,上面只有Grayson Kent的结构:
npm notice created a lockfile as package-lock.json. You should commit this file.
所以package-lock.json也应该提交给你的源代码控件。