-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
50 lines (42 loc) · 966 Bytes
/
webpack.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
47
48
49
50
const webpack = require('webpack')
const path = require('path')
const config = {
target: 'web',
resolve: {
extensions: ['.js', '.json', '.ts'],
},
module: {
loaders: [
{
loader: 'babel-loader',
test: /\.jsx?$/,
exclude: /node_modules/
},
{
// Typescript compiled by awesome-typescript-loader
// targeting ES2015 then passed to Babel for backwards compatibility.
loaders: ['babel-loader', 'awesome-typescript-loader'],
test: /\.tsx?$/,
exclude: /node_modules/
}
]
},
externals: {
// loaded separately in the browser
'search-index': 'SearchIndex'
},
devtool: 'source-map',
plugins: [
],
context: path.join(__dirname, 'src'),
entry: {
search: ['./search.ts']
},
output: {
path: path.join(__dirname, 'dist/'),
publicPath: '/',
filename: '[name].js',
chunkFilename: '[name].js'
}
}
module.exports = config