-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
92 lines (90 loc) · 2.55 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const { WebpackError } = require('webpack');
module.exports = {
entry: {
client: ['./src/client/client.ts', 'webpack-hot-middleware/client'],
},
module: {
rules: [
{
test: /\.[tj]sx?$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" }
]
},
//{ test: /\.(jpe?g|png|gif|woff|woff2|eot|ttf|svg)$/i, loader: 'file-loader'},
/*{
test: /\.(png|svg|gif)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
},
},
],
},*/
{
test: /\.(jpg|png|gif|svg)$/,
use: {
loader: 'file-loader',
options: {
esModule: false
}
}
}
],
/*loaders: [
{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192' }
]*/
},
resolve: {
fallback: {
fs: false,
net: false,
"assert": require.resolve("assert/")
},
extensions: ['.tsx', '.ts', '.js'],
alias: {
util3: require.resolve("util/"),
utils: path.resolve(__dirname, 'src/client/utils/'),
}
},
devtool: 'inline-source-map',
devServer: {
hot: false,
inline: false,
contentBase: './dist'
},
mode: 'development',
plugins: [
new HtmlWebpackPlugin({
hash: true,
template: './src/client/index.html',
filename: 'index.html',
favicon: "./src/client/screen/images/ROWfavicon.ico"
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_DEBUG': JSON.stringify('development')
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
})
],
output: {
libraryExport: 'default', //Nejc's line
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/'
}
};