-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.config.js
More file actions
57 lines (55 loc) · 1.49 KB
/
webpack.config.js
File metadata and controls
57 lines (55 loc) · 1.49 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
var webpack = require('webpack'),
path = require('path'),
HtmlWebpackPlugin = require('html-webpack-plugin');
var src = './src',
entry = path.resolve(src, 'js/index.js'),
jsPath = './js/',
outputName = 'bundle.min.js',
nodeModulesPath = path.join(__dirname, 'node_modules'),
base = path.join(__dirname, 'dist'),
templates = path.join(__dirname, src+'/index.html');
module.exports = {
entry: entry,
output: {
path: base,
filename: path.join(jsPath, outputName),
},
module: {
loaders: [
{
test: /\.css$/,
loader: "style!css"
},
{
test: /\.(glsl|vs|fs)$/,
loader: 'shader-loader',
options: {
glsl: {
chunkPath: path.resolve('/glsl/chunks')
}
}
}
],
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['env']
}
}
},
{
test: /\.css$/,
use: [ 'style-loader', 'css-loader' ]
}
]
},
devtool: 'inline-source-map',
plugins: [
new HtmlWebpackPlugin({template: templates, filename: "./index.html"})
//new webpack.optimize.UglifyJsPlugin({minimize: true})
]
};