-
Notifications
You must be signed in to change notification settings - Fork 60
/
backpack.config.js
46 lines (41 loc) · 1.16 KB
/
backpack.config.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
var TypedocWebpackPlugin = require('typedoc-webpack-plugin');
module.exports = {
webpack: (config, options, webpack) => {
config.entry.main = ['./server/index.ts'];
config.resolve = {
extensions: ['.ts', '.js', '.json']
};
config.module.rules.push({
test: /\.ts$/,
exclude: /(node_modules)/,
loader: 'awesome-typescript-loader'
});
config.module.rules.push({
test: /\.graphql?$/,
loader: 'webpack-graphql-loader'
});
if (options.env === 'production') {
config.plugins = [
...config.plugins,
new TypedocWebpackPlugin(
{
out: './docs',
target: 'es6',
module: 'commonjs',
moduleResolution: 'node',
experimentalDecorators: true,
emitDecoratorMetadata: true,
exclude: '**/node_modules/**/*.*',
excludeExternals: true,
includeDeclarations: false,
ignoreCompilerErrors: true,
excludePrivate: true,
lib: ['lib.esnext.full.d.ts', 'lib.esnext.asynciterable.d.ts']
},
['./server']
)
];
}
return config;
}
};