This repository has been archived by the owner on May 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
85 lines (81 loc) · 2.93 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
var path = require('path');
var webpack = require('webpack');
var _root = __dirname + '/';
var scriptsRoot = _root + 'src/';
var stylesRoot = _root + 'styles/';
var vendorScripts = scriptsRoot + 'vendor/';
module.exports = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./src/app/main'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/release/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.ProvidePlugin({
'fetch': 'imports-loader?this=>global!exports-loader?global.fetch!whatwg-fetch'
})
],
module: {
loaders: [
{
include: /\.json$/,
loaders: ['json-loader']
},
{
test : /\.html$/, loader: 'html-loader'
},
{
test : /\.less$/, loader: 'style-loader!css-loader!less-loader'
},
{
test : /\.css$/, loader: 'style-loader!css-loader'
},
{
test : /\.(png|jpe?g|eot|ttf|svg|gif)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=8192&hash=sha512&digest=hex&name=[hash].[ext]'
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?mimetype=application/font-woff'
},
{ test: /\.jpg$/,
loader: 'file-loader?name=[path][name].[ext]'
},
{
test: /\.js$/,
loaders: ['react-hot-loader', 'babel-loader'],
include: path.join(__dirname, 'src')
},
]
},
resolve: {
extensions: ['.js', '.jsx', '.json', '.css', '.html'],
// modulesDirectories: ['node_modules', 'bower_components'],
modules: [
'./src',
'./src/app',
'./node_modules'
],
alias: {
'app.css' : stylesRoot + 'app.css',
'bootstrap.min.css' : vendorScripts + 'bootstrap/css/bootstrap.min.css',
'bootstrap.theme.min.css' : vendorScripts + 'bootstrap/css/bootstrap-theme.min.css',
'bootstrap' : vendorScripts + 'bootstrap/js/bootstrap.js',
'bootstrap.min' : vendorScripts + 'bootstrap/js/bootstrap.min.js',
'metisMenu.min.css' : stylesRoot + 'metis/metisMenu.min.css',
'font-awesome.min.css' : stylesRoot + 'fontawesome/css/font-awesome.min.css',
'awesome-bootstrap-checkbox.css' : stylesRoot + 'awesome-bootstrap-checkbox.css',
'BahnService' : scriptsRoot + 'services/BahnService.js',
'OpenLok' : scriptsRoot + 'components/OpenLok.js'
}
},
//useMemoryFs: true,
//progress: true
};