config: fix imports not working correctly
this patch moves the rootDir of the typescript project up a directory this moves all content in the dist directory inside the new src directory I couldn't find other way
This commit is contained in:
parent
46bb5c867d
commit
18646b9dc6
4 changed files with 15 additions and 7 deletions
12
src/index.ts
12
src/index.ts
|
@ -23,9 +23,17 @@ function getConfig() {
|
|||
["./config.ts"],
|
||||
{outDir: "./dist"}
|
||||
);
|
||||
program.emit(program.getSourceFile("./config.ts"));
|
||||
|
||||
program.getSourceFiles()
|
||||
.filter(e => {
|
||||
if (!e.fileName.match(`^${process.cwd()}`)) return true;
|
||||
if (e.fileName.match(`${process.cwd()}/node_modules`)) return false;
|
||||
if (e.fileName.match(`${process.cwd()}/src/`)) return false;
|
||||
return true;
|
||||
})
|
||||
.forEach(e => program.emit(e));
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-member-access
|
||||
fileConfig = require("./config").default as IConfig;
|
||||
fileConfig = require("../config").default as IConfig;
|
||||
} catch (e) {
|
||||
//FIXME: make errors more descriptive to the enduser
|
||||
console.log(e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue