1.1.0 • Published 5 years ago
@novotea/nx-lib-bundle v1.1.0
@novotea/nx-lib-bundle
What is nx-lib-bundle
nx-lib-bundle is a minimalistic attempt at bundling NX workspace libraries in individual publishable npm packages. It has no dependencies on NX itself, but uses the layout conventions of NX to discover the version, npmScope and possible packages it can build.
What will nx-lib-bundle do
Upon execution nx-lib-bundle will performs the following tasks:
- Look for
nx.json,workspace.jsonandpackage.json - Build node package files in
distwith the npmScope and project name - Use the version number of
package.json - If a
package-template.jsonis found in the workspace root, then its content will be added to the generatedpackage.json - If a
package-template.jsonis found in a library project directory, then its content will be added to the generatedpackage.json - Build flattenend ES5 and ES2015 versions of the projects in UMD and ES formats with sourcemaps included
- The UMD format also contains a minified version
- Create typings for these projects
- Setup the corresponding package.json and set dependencies. The versions for these
dependencies will be taken from the nxpackage.json
nx-lib-bundle uses rollup and uglify-js to achieve its goals.
How to install
npm i -D @novotea/nx-lib-bundleUsage
npx nx-lib-bundle --helpnx-lib-bundle <cmd> [args]
Commands:
nx-lib-bundle all build all nx workspace libraries
nx-lib-bundle bundle <projects...> Bundle multiple nx workspace libraries
Options:
--output, -o Target directory of the bundle [string] [default: "dist"]
--version Show version number [boolean]
--help Show help [boolean]