-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
56 lines (48 loc) · 1.34 KB
/
webpack.config.js
File metadata and controls
56 lines (48 loc) · 1.34 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
'use strict';
const NODE_ENV = process.env.NODE_ENV || 'pokestars';
const webpack = require('webpack');
const fs = require('fs');
const path = require('path');
module.exports = {
entry: {
app: './app/app.js'
},
output: {
path: __dirname,
filename: "dist/[name].js",
library: '[name]'
},
watch: NODE_ENV == 'pokestars',
resolve: {
modulesDirectories: ['node_modules'],
extensions: ['', '.js', '.css', '.html']
},
resolveLoader: {
modulesDirectories: ['node_modules'],
moduleTemplates: ['*-loader', '*'],
extensions: ['', '.js', '.css', '.html']
},
plugins: [
new webpack.NoErrorsPlugin()
],
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015']
},
},
{ test: /\.css$/, loader: 'style-loader!css-loader?resolve url' },
{ test: /\.html$/, loader: 'html' },
{ test: /\.(woff|woff2|ttf|svg|eot|png|svg|jpg)$/, loader: 'file?name=[path][name].[ext]?[hash]' }
]
},
devServer: {
hot:true,
historyApiFallback:true,
port:3000
}
};
console.log(`Server runnig at localhost:${module.exports.devServer.port}`);