-
Notifications
You must be signed in to change notification settings - Fork 12k
CLI Webpack does not work with linked local packages #2154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It sounds to me like this must be a problem specific to the project type. I ran this a similar scenario the other day. I was having problems figuring out how to use a require.js lib because brocoli kept through errors as it wasn't a typescript project dispite the fact i had updated my type definitions and could build with the typescript compiler directly, so i thought i would try the webpack branch and that fixed the issue. Then i had the situation where i wanted to make changes to the require.js app so i also had to use an npm link to debug it all together. I didn't have any issues with it. |
I went ahead and published my library package to our npm repo and installed it from there and it works as expected. The problems only exist when the library package is linked locally. |
Agree, having same problem. I have other reusable components installed via Any solutions so far? PS. There's the link for workaround http://webpack.github.io/docs/troubleshooting.html#npm-linked-modules-doesn-t-find-their-dependencies, but webpack configuration isn't available for us to modify :( |
|
Not sure how to escalate this or at least get someone from the CLI team to look at it but if it can't be addressed soon I'll have to move my current and future projects to a Gulp tooling workflow. We do a lot of development inside linked packages, a fair amount of our core functions are shared in npm packages. This issue is blocking progress for my team. |
Dupe of #1875 |
Here is an explanation how to do it properly: https://github.com/angular/angular-cli/wiki/stories-linked-library And here it is more elaborated: Solution (If you want to develop and build lib through the hosting app. This method will build the library with the methods and configuration of your app. Production releases can behave differently)
{
...
"compilerOptions": {
...
"baseUrl": "./",
"note1": "these paths are relative to `baseUrl` path.",
"paths": {
"@angular/*": [
"node_modules/@angular/*"
]
}
...
}
...
}
{
...
"defaults": {
"build": {
"preserveSymlinks": true
}
}
...
} in this way you should be fine building lib in many scenarios
|
i have similar problem with dir structure:
reproduce steps:
start demo
messy workaroundremoving path mapping inside
library dependecies:
demo dependencies:
any idea? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Linux CentOs 7
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:angular-cli: 1.0.0-beta.14
node: 6.2.2
os: linux x64
do on your code? etc.
This app was created using the CLI Beta 10 then updated following this guide
more information.
I have a local Angular 2 library Package that I link (npm link mypackage) during development of this library. I have been working on this package in this manner for 6 months with no issues. Now that I am trying to upgrade to the CLI webpack version it no longer works
I have the package referenced in the dependencies section of my web app package.json file. I can see the sym link in my projects node_modules directory but it's like it does not exist when the app runs.
Another issue is that I have some css files inside this package but when I reference them in the angular-cli they are not loaded when the app loads.
The text was updated successfully, but these errors were encountered: