ngx-carousel
ngx-carousel copied to clipboard
Building from source fails
Attempting to build from source fails. I think there are some missing dependencies, and general cleaning of the package required
- Remove dist and compiled files folder from Git
- Add 'postinstall' script to build after install
- Fix dependencies for build
- Add package-lock.json for NPM 5
Testing: How is the docs folder related to the project? If this is your test base how did you generate it, as it seems seporate to the build and does not make use of the lates builds. Ideally anyone who downloads or forks the source should be able to run some tets to make sure no regression has been introduced. Implmenting some propper testing as well as an examples folder would be best.
Thoughts?
I will add it to next update
I noticed that the dist folder is back in the repo? Generally I advise not to include build artifacts in the repo as it causes a mess of commits and system specific build conflicts.
In my merged PR i added a postinstall script which will run after any npm install. This will build and overwrite the dist directory in the node_modules folder of the installer.
This of course is upto you, as including the dist folder does make it simpler to just copy and paste the compiled js into a project without using npm.
Including a main feild in the package.json will direct any includes of your package to provide the specified file as the module entrypoint, eg: "main": "dist/bundles/ngxcarousel.umd.min.js"
EDIT: I see now that you are only publishing the dist folder to NPM. Its is still possible to do this as a step after building using the prepare npm hook eg: "prepare": "npm run build". this will build successfully before you can publish, its also a good idea to run test here. So you can't publish broken builds.