forked from jippi/hashi-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
57 lines (55 loc) · 1.74 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
const path = require('path');
const merge = require('webpack-merge');
const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const HtmlWebpackPlugin = require('html-webpack-plugin');
var webpackConfig = require("./webpack-base.config.js");
webpackConfig = merge(webpackConfig, {
output: {
filename: 'bundle.js'
},
entry: [
'webpack-dev-server/client?http://localhost:3333',
'webpack/hot/only-dev-server',
'./src/main.js'
],
devtool: 'cheap-module-eval-source-map',
plugins: [
new HtmlWebpackPlugin({
title: 'Nomad UI',
inject: false,
template: './index.html.ejs',
favicon: './assets/img/favicon.png',
appMountId: 'app'
}),
new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"development"' }),
new webpack.HotModuleReplacementPlugin()
],
devServer: {
port: 3333,
hot: true,
historyApiFallback: true,
publicPath: webpackConfig.output.publicPath
},
module: {
loaders: [
{
test: /\.css$/,
loader: 'style!css!postcss'
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
loaders: [
'react-hot',
'babel?presets[]=es2015,presets[]=es2016,presets[]=react,plugins[]=syntax-trailing-function-commas,plugins[]=transform-runtime,plugins[]=transform-class-properties,plugins[]=transform-object-rest-spread'
]
},
{
test: /\.scss$/,
loader: 'style!css?-autprefixer!postcss!sass'
}
]
}
});
module.exports = webpackConfig;