Closed arthurhsu closed 4 years ago
First attempt: use rollup and its TypeScript plugin. It successfully generates lf.js, but there are two showstopper:
The rollup config tested is
import multiEntry from 'rollup-plugin-multi-entry';
import typescript from 'rollup-plugin-typescript2';
export default {
input: 'lib/**/*.ts',
output: [{
name: 'lf',
file: 'dist/lf.js',
format: 'umd'
}],
plugins: [
multiEntry(),
typescript()
]
}
Use one index.ts
to export everything you want and this index.ts
would be the entry too. And it would make rollup and https://www.npmjs.com/package/dts-bundle-generator easy to setup.
Dist target created, now it can generate one single TypeScript file, that in turn compile into one JS file without changing TSConfig. Advantage: I no longer need to care about umd/commonjs/es6 since everything is in a file.
Remaining work:
Create dist and npm package, while keeping most of the Lovefield public API usage. This will need to write a sample test to test usage of it (maybe the harness min one).