-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathwebpack.config.js
More file actions
64 lines (63 loc) · 1.92 KB
/
webpack.config.js
File metadata and controls
64 lines (63 loc) · 1.92 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
61
62
63
64
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
devtool: 'sourcemap',
entry: {
app: ['./src/index.js']
},
output: {
path: path.resolve(__dirname, 'build'),
publicPath: './',
filename: 'instead.[hash].js'
},
module: {
loaders: [
{
test: /\.css/,
loader: ExtractTextPlugin.extract({fallback: 'style-loader', use: 'css-loader'})
},
{
test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file-loader'
},
{
test: /\.html$/,
loader: 'raw-loader'
}
]
},
plugins: [
new CopyWebpackPlugin([
{from: 'instead/themes', to: 'themes'},
{from: 'instead/git/instead/icon/sdl_instead_1x32.png', to: 'instead.png'},
{from: 'scripts/list_games.js'},
{from: 'instead/stead2.json'},
{from: 'instead/stead3.json'},
{from: 'node_modules/text-encoding/lib/encoding.js'},
{from: 'node_modules/text-encoding/lib/encoding-indexes.js'}
], {
ignore: [
'Makefile',
'CMakeLists.txt',
'Makefile.windows'
]
}),
new HtmlWebpackPlugin({
template: './src/index.html',
inject: 'body'
}),
new ExtractTextPlugin('style.[hash].css')
],
devServer: {
contentBase: './build',
stats: 'minimal'
},
resolve: {
alias: {
fs: path.join(__dirname, 'src', 'lua', 'stubs', 'fs.js'), // filesystem
ws: path.join(__dirname, 'src', 'lua', 'stubs', 'ws.js') // websockets
}
}
};