jvandemo / jvandemo/generator-angular2-library
Consuming your library in a local application during development, WebpackDevServer example
- Dominant language
- JavaScript
- Stars
- 740
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
Tried to preview a module with `npm link` on a project that uses not `AngularCLI` (as it is a Hybrid ng1-ng2 app), but a WebpackDevServer. Everything rebuilds on new package build.
But when page refreshes with built version of package - getting an `Error: Unexpected value '[object Object]' imported by the module 'AppModule'. Please add a @NgModule annotation.`, which is fixed under AngularCLI, by adding `--preserve-symlinks` flag to `ng serve`.
Exact same version works great, when built -> pushed to GitHub -> `npm upgrade package_name` into project.
Maybe you can advice a solution for a Webpack in this case? Would be also great to have a knowledge on Why this is happening.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the npm link workflow with the project's WebpackDevServer setup and compare it with the AngularCLI behavior described in the issue. Investigate why refreshing a locally linked build produces the NgModule error, then document a working Webpack configuration or usage pattern and verify that refreshes succeed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, javascript, webpack
- Domain
- build-system, developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100