forked from goloveychuk/tsruntime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.test.js
52 lines (39 loc) · 975 Bytes
/
webpack.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const TsRuntimeTransformerBuilder = require('./dist/transformer').default;
function CustomTransformersBuilder(program) {
const tsruntimeTrans = TsRuntimeTransformerBuilder(program)
return () => ({
before: [
tsruntimeTrans
]
})
}
module.exports = function (options) {
return {
devtool: '#inline-source-map',
// note: not used by karma, but can be used
// to help debug transform code by running webpack directly
entry: './tests/spec-bundle.js',
output: {
filename: './tests/build/test.bundle.js'
},
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
// Typescript
{
test: /\.ts$/,
use: [
{
loader: 'awesome-typescript-loader',
options: {
getCustomTransformers: CustomTransformersBuilder,
}
},
],
},
],
}
};
};