-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.ts
More file actions
48 lines (41 loc) · 845 Bytes
/
webpack.config.ts
File metadata and controls
48 lines (41 loc) · 845 Bytes
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
import * as path from 'path';
import * as fs from 'fs';
export function getExampleWebpackConfig(root: string): any
{
if (fs.existsSync(path.join(root, 'webpack.config.ts'))) {
return require(path.join(root, 'webpack.config.ts')).default;
}
return {
devtool: 'source-map',
entry: {
app: path.join(root, 'app', 'bootstrap.ts'),
},
output: {
path: path.join(root, 'public'),
filename: 'app.js',
},
resolve: {
extensions: ['.js', '.json', '.ts'],
},
module: {
rules: [
{
test: /\.ts$/,
use: [
{
loader: 'ts-loader',
options: {
configFile: path.join(root, 'tsconfig.json')
},
},
{
loader: '@slicky/webpack-loader',
},
],
},
{test: /\.html$/, use: 'raw-loader'},
{test: /\.css$/, use: 'raw-loader'},
],
},
};
}