diff --git a/config/modules/transformer/tsconfig.json b/config/modules/transformer/tsconfig.json index 94c5a6f1e..d7f5822f8 100644 --- a/config/modules/transformer/tsconfig.json +++ b/config/modules/transformer/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../../dist/transformer" + "declaration": true, + "outDir": "../../../dist" } } diff --git a/config/modules/transformer/webpack.js b/config/modules/transformer/webpack.js index d1916b82a..352935e8b 100644 --- a/config/modules/transformer/webpack.js +++ b/config/modules/transformer/webpack.js @@ -15,10 +15,9 @@ module.exports = merge(base({ webpackNodeExternals() ], entry: { - index: './src/transformer/transformer.ts', + index: './src/transformer/index.ts', }, output: { path: path.resolve(__dirname, "../../../dist/transformer"), - filename: "index.js" } }); diff --git a/src/transformer/index.ts b/src/transformer/index.ts new file mode 100644 index 000000000..cf0352645 --- /dev/null +++ b/src/transformer/index.ts @@ -0,0 +1,3 @@ +import { transformer } from './transformer'; + +export default transformer; diff --git a/src/transformer/transformer.ts b/src/transformer/transformer.ts index a78e3a88e..22914af86 100644 --- a/src/transformer/transformer.ts +++ b/src/transformer/transformer.ts @@ -5,7 +5,7 @@ import { getMock, getMockForList, storeRegisterMock } from './mock/mock'; import { MockDefiner } from './mockDefiner/mockDefiner'; import { SetTypeChecker, TypeChecker } from './typeChecker/typeChecker'; -export default function transformer(program: ts.Program, options?: TsAutoMockOptions): ts.TransformerFactory { +export function transformer(program: ts.Program, options?: TsAutoMockOptions): ts.TransformerFactory { SetTsAutoMockOptions(options); SetTypeChecker(program.getTypeChecker());