-
Notifications
You must be signed in to change notification settings - Fork 47
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
Publish library as a JS package on NPM #47
Comments
I don't understand. Have you followed those steps to build and publish on npm registry? Have you searched/opened a stackoverflow issue for the error message you get? |
Hello @fabioformosa Yes its exactly the tutorial that I followed. And I achieve to have a working compilation and get it published on npm. The problem is only after when I try to install. I tried searching on stackoverflow but the error seems to common and I didn't found answer that was matching the case |
Hello guys! The library as beed made compatible with angular >4 If you want to try in a angular 6 project, then: and in your angular-cli.json "assets": [
{ "glob": "**/*", "input": "../node_modules/ngx-admin-lte/public/assets", "output": "./assets" }
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js",
"../node_modules/admin-lte/dist/js/app.min.js"
], and in your style.css @import "../node_modules/angular2-toaster/toaster.css";
@import "../node_modules/admin-lte/dist/css/AdminLTE.min.css";
@import "../node_modules/admin-lte/dist/css/skins/_all-skins.min.css";
@import "../node_modules/bootstrap/dist/css/bootstrap.min.css";
@import "../node_modules/font-awesome/css/font-awesome.min.css";
@import "../node_modules/ionicons/dist/css/ionicons.min.css"; |
Great! I will test ASAP with angular 5. |
It was related to peerDependencies, now i builded with ng-packagr and it fixed =) |
@TwanoO67 This issue is done now, am I missing anything ? |
Jquery was missing on beta-9, but it seems ok now on beta-10. |
I disagree with |
Hello Guys!
For the moment the package is published as a TS module.
So it is compiled with your typescript settings when you use it.
But this mode of using is not allowed with the new angular/cli versions.
So I would like to publish the package as a JS lib.
I already tried that on develop (i did a "yarn build" function, that produce a dist folder, and use that on the package.json).
But then when I use it on a project, it compile right, but it fail on loading, with errors like so:
Uncaught ReferenceError: UserService is not defined at eval (can-activate-guard.service.js:33) at eval (can-activate-guard.service.js:36) at Object../node_modules/ngx-admin-lte/dist/src/services/can-activate-guard.service.js (vendor.bundle.js:317)
It seems that the internal service aren't able to load each other anymore.
Does any of you already create a JS package on NPM and have some example to help me with that ?
Any idea would be much appreciated!
The text was updated successfully, but these errors were encountered: