-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.config.js
70 lines (69 loc) · 1.77 KB
/
webpack.dev.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
const path = require('path');
const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
index: './js/index.js'
},
output: {
path: path.resolve(__dirname, 'build'),
filename: '[name].bundle.js',
chunkFilename: '[id].bundle.js',
publicPath: '/'
},
debug: true,
devtool: 'source-map',
module: {
preLoaders: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules)/,
loader: 'eslint?{quiet:true,rules:{\'no-debugger\':1}}'
}
],
loaders: [
{
test: /\.css$/,
loader: 'style/useable!css!postcss!'
},
{
test: /\.less$/,
loader: 'style!css!postcss!less!'
},
{
test: /\.(js|jsx)$/,
loader: 'react-hot!babel?presets[]=react&presets[]=es2015',
exclude: /(node_modules)/
}
]
},
postcss: () => {
return [
autoprefixer({browsers: ['last 5 versions']})
];
},
resolve: {
root: [
path.resolve(__dirname),
path.resolve(__dirname, 'js', 'fw', 'lib')
]
},
plugins: [
new CopyWebpackPlugin([
{from: 'img', to: 'img'}
]),
new webpack.optimize.CommonsChunkPlugin('common.bundle.js'),
new HtmlWebpackPlugin({
title: 'BTC-E | Bitcoin trading fee calculator',
description: 'Bitcoin trading fee calculator calculates an amount of profits, losses, and threshold. The calculator supports the BTC-e bitcoin exchange with 0.2% transaction fee.',
username: 'my8bit',
filename: 'index.html',
inject: 'body',
template: 'index.html_vm',
favicon: 'img/favicon.ico',
hash: false
})
]
};