尝试开发一个与Angular一起使用的分叉项目

时间:2017-07-21 20:12:55

标签: angular fork rollup

我正在努力为ng2-pop-over套餐制作PR。首先,我想通过将console.log放入ngOnInit来进行一个简单的测试,看看我是否正在以正确的方式在本地构建和npm link包,所以我:

  • 分叉并克隆了该项目。
  • npm i
  • npm run build

并得到了一堆警告,如下所示。

⚠️   '@angular/common' is imported by dist/index.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency

⚠️   '@angular/core' is imported by dist/pop-over.component.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency

⚠️   'rxjs/Rx' is imported by dist/pop-over.component.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency

⚠️   '@angular/core' is imported by dist/pop-over-trigger.directive.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency

⚠️   'rxjs' is imported by dist/pop-over-trigger.directive.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency

⚠️   '@angular/core' is imported by dist/index.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency

⚠️   No name was provided for external module 'rxjs/Rx' in options.globals – guessing 'rxjs_Rx'

⚠️   No name was provided for external module 'rxjs' in options.globals – guessing 'rxjs'
  • 因为这些都是警告,我忽略了它们并做了npm link
  • 回到我的项目中我做了npm link ng2-pop-over
  • angular没编译:

编译失败。

./~/ng2-pop-over/index.js
Module build failed: Error: ENOENT: no such file or directory, open '/Users/user1/Code/PopoverTest/node_modules/ng2-pop-over/index.js'
    at Error (native)
 @ ./src/app/app.module.ts 22:0-45
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts 

我做错了什么?

0 个答案:

没有答案