Skip to content

Commit

Permalink
fix: ts configs
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed May 8, 2021
1 parent 16e42f2 commit 34e35a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 6 additions & 3 deletions core/core/src/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const dynamicRequire = (filePath: string): any => {
ts.readConfigFile(configPath, ts.sys.readFile).config,
);
}

const tmpDir = dirSync();
config.config.compilerOptions.outDir = tmpDir.name;
try {
Expand All @@ -65,8 +64,12 @@ export const dynamicRequire = (filePath: string): any => {
}
ts.sys.writeFile(fileName, data);
});
const result = esmRequire(jsFilePath);
return result;
try {
const result = esmRequire(jsFilePath);
return result;
} catch (e) {
throw new Error(`error compiling file ${filePath}`);
}
} finally {
fs.rmdirSync(tmpDir.name, { recursive: true });
// tmpDir.removeCallback();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import path from 'path';
import { BuildConfiguration } from '@component-controls/core';
require('dotenv').config();
//const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
// .BundleAnalyzerPlugin;

const config: BuildConfiguration = {
const config = {
stories: [
'../../stories/src/blogs/*.mdx',
'../../stories/src/showcase/*.mdx',
Expand Down

0 comments on commit 34e35a1

Please sign in to comment.