-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwebpack.config.js
41 lines (31 loc) · 1.11 KB
/
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
var path = require('path');
module.exports = {
// set the base folder as context for the project
context: path.join(__dirname, 'src'),
// set the entry point for this project
entry: 'index.ts',
// enable loading modules relatively (without the ../../ prefix)
resolve: {
root: [path.join(__dirname, "src")],
extensions: ['', '.webpack.js', '.ts', '.js']
},
module: {
loaders: [
// all files with a `.ts` extension will be handled by `ts-loader`
{ test: /\.ts$/, exclude: [/node_modules/], loader: 'ts-loader'},
// load css files and convert it to inline styles
{test: /\.css$/, exclude: [/node_modules/], loader: 'style!css-loader'},
// load fonts(inline base64 URLs for <=8k)
{ test: /\.(ttf|eot|svg|otf)$/, loader: "file" },
{ test: /\.woff(2)?$/, loader: "url?limit=8192&minetype=application/font-woff"},
// load images (inline base64 URLs for <=8k images)
{test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'}
]
},
// webpack dev server configuration
devServer: {
contentBase: "./src",
inline: true,
port: 3030
}
};