-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathwebpack.config.ts
More file actions
34 lines (32 loc) · 877 Bytes
/
webpack.config.ts
File metadata and controls
34 lines (32 loc) · 877 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
import { resolve } from 'path';
import { Configuration } from 'webpack';
const config: Configuration = {
devtool: 'source-map',
entry: ['whatwg-fetch', './src/doc_viewer.ts'],
output: {
filename: 'scripts/doc_viewer.js',
path: resolve('./public')
},
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader',
options: {
silent: true
}
}
]
},
resolve: {
extensions: ['.ts', '.js', '.json'],
modules: [resolve('./src'), resolve('./node_modules')],
alias: {
// A module requesting highlight.js will load just the bare
// highlighter, and will then register languages of interest
'highlight.js$': resolve('./node_modules/highlight.js/lib/highlight.js')
}
}
};
export default config;