-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
63 lines (62 loc) · 1.75 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
var path = require("path");
var webpack = require("webpack");
// webpack.config.js
module.exports = {
devtool: 'source-map',
debug: true,
cache: true,
verbose: true,
displayErrorDetails: true,
//context: __dirname,
// our Development Server config
devServer: {
inline: true,
colors: true,
//historyApiFallback: true,
contentBase: './public',
//publicPath: './dist'
},
entry: {
'bundle.js': ['./src/entry.ts']
},
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: './',
filename: '[name]',
sourceMapFilename: '[name].js.map',
},
plugins: [
new webpack.ProvidePlugin({
// Automatically detect jQuery and $ as free var in modules
// and inject the jquery library
// This is required by many jquery plugins
jQuery: "jquery",
$: "jquery"
})
],
module: {
loaders: [
{ test: /\.ts$/, loader: 'babel-loader!ts-loader' },
{ test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
},
{ test: /\.scss$/, loader: 'style!css!sass' },
{ test: /\.html$/, loader: 'html' },
{ test: /\.css$/, loader: 'style!css' },
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
'file?hash=sha512&digest=hex&name=[hash].[ext]',
'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
]
},
{
test: /\.woff2?$|\.ttf$|\.eot$|\.svg$/,
loader: 'file'
}
]
}
};