How to build typescript module to javascript module
this is my tsconfigFile
{
"compilerOptions": {
"target": "ES5",
"module": "CommonJS",
"declaration": true,
"outDir": "./dist",
"strict": true,
"moduleResolution": "Node",
"esModuleInterop": true,
"skipLibCheck": true
}
}
I want to Buiding This Code --------------
Typescript Module
import getData from './getData';
export default {
getData
};
node Module
const getData = require("./getData")';
module.exports = {
getData
};
Since your config seems to have the needed settings to generate node modules, I think you just need to run the
tsc
command, and it will generate the JS code and store it in the./dist
directory.