Package Exports
- @loopback/dist-util
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@loopback/dist-util) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@loopback/dist-util
This package is no longer actively maintained.
Please upgrade your project to use a single compilation target, for example by
changing your build script in package.json as follows:
{
"scripts": {
"build": "lb-tsc es2017 --outDir dist"
}
}Overview
Utilities to work with dist folders used by different Node.js versions.
| version | directory |
|---|---|
| 6.x LTS | not supported |
| 8.x LTS | dist8 |
| 9.x | dist8 |
| 10.x | dist10 |
| newer | dist10 |
Installation
Run the following command to install this package:
$ npm install @loopback/dist-utilBasic Use
Configure your TypeScript build to produce two distribution versions:
dist8compiled fores2017targetdist10compiled fores2018target
Put the following line to your main index.js file:
module.exports = require('@loopback/dist-util').loadDist(__dirname);
// calls `require(__dirname + '/dist8')` or `require(__dirname + '/dist10')`It is also possible to obtain the name of the correct dist directory without
loading the dist files:
const dist = require('@loopback/dist-util').getDist();
console.log(dist);
// prints `dist8` or `dist10`Contributions
Contributors
See all contributors.
License
MIT