Repository navigation
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
76 lines (67 loc) · 1.69 KB
/
Copy pathwebpack.config.dev.js
File metadata and controls
76 lines (67 loc) · 1.69 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
'use strict';
const path = require('path');
const webpack = require('webpack');
const NODE_ENV = process.env.NODE_ENV;
module.exports = {
target: 'web',
devtool: 'cheap-module-eval-source-map',
entry: [
'babel-polyfill',
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/dev-server',
'./assets/main.jsx',
],
output: {
path: path.join(__dirname, '/public/dist/'),
filename: 'bundle.js',
pathInfo: true,
publicPath: 'http://localhost:8080/dist/',
hot: true,
},
resolve: {
root: path.join(__dirname, ''),
modulesDirectories: [
'web_modules',
'node_modules',
'assets',
'assets/components',
'assets/styles',
],
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx'],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
__ENV__: NODE_ENV,
}),
],
externals: {
'cheerio': 'window',
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
},
module: {
loaders: [
{
test: /\.scss$/, // sass files
loader: 'style!css!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded',
},
{
test: /\.css$/,
loader: "style!css"
},
{
test: /\.(ttf|eot|svg|woff)(\?[a-z0-9]+)?$/, // fonts files
loader: 'file-loader?name=[path][name].[ext]',
},
{
test: /\.(jsx)?$/, // react files
exclude: /node_modules/,
loaders: ['react-hot-loader', 'babel?presets[]=es2015,presets[]=stage-0,presets[]=react'],
include: path.join(__dirname, 'assets'),
},
],
noParse: /\.min\.js/,
},
};