-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
60 lines (59 loc) · 1.67 KB
/
webpack.dev.js
File metadata and controls
60 lines (59 loc) · 1.67 KB
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
const path = require('path');
const webpack = require('webpack');
const BUILD_DIR = path.resolve(__dirname, 'src/main/resources/static/js/');
module.exports = {
entry: './src/main/resources/static/tsx/App',
output: {
path: BUILD_DIR + '',
filename: 'bundle.js'
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
],
resolve: {
modules: [path.resolve(__dirname, 'src/main/resources/static/tsx'), 'node_modules'],
extensions: ['.js', '.jsx', '.json', '.ts','.tsx'],
},
devServer: {
historyApiFallback: true,
watchContentBase: true,
contentBase: BUILD_DIR,
publicPath: '/',
host: '0.0.0.0',
port: 8082,
proxy: {
'**': 'http://127.0.0.1:8081'
},
},
module: {
loaders: [
{
test: /\.(js|jsx|ts|tsx)$/,
exclude: [/node_modules[\\\/](?!callbag-\w+)/, /bower_components/],
loader: 'babel-loader',
options: {
cacheDirectory: true,
},
},
{
test: /\.(css|scss)$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
},
{
loader: 'sass-loader',
},
],
},
{test: /\.(png|jpe?g)(\?.*)?$/, loader: 'url?limit=8182'},
{test: /\.(svg|ttf|woff|eot)(\?.*)?$/, loader: 'file'}
]
}
};