forked from planttheidea/react-style-tag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
98 lines (83 loc) · 1.98 KB
/
webpack.config.dev.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
86
87
88
89
90
91
92
93
94
95
96
97
98
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const eslintFriendlyFormatter = require('eslint-friendly-formatter');
const PORT = 3000;
module.exports = {
cache: true,
debug: true,
devServer : {
contentBase: './dist',
host: 'localhost',
inline: true,
lazy: false,
noInfo: false,
quiet: false,
port: PORT,
stats: {
colors: true,
progress: true
}
},
devtool: 'eval-cheap-module-source-map',
entry: [
path.resolve (__dirname, 'DEV_ONLY', 'App.js')
],
eslint: {
configFile: '.eslintrc',
emitError: true,
failOnError: true,
failOnWarning: false,
formatter: eslintFriendlyFormatter
},
module: {
preLoaders: [
{
include: [
path.resolve(__dirname, 'src')
],
loader: 'eslint-loader',
test: /\.js$/
}
],
loaders: [
{
loader: 'json',
test: /\.json$/
}, {
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'DEV_ONLY')
],
loader: 'babel',
test: /\.js$/
}
]
},
node: {
fs: 'empty'
},
output: {
filename: 'react-style-tag.js',
library: 'ReactStyleTag',
path: path.resolve(__dirname, 'dist'),
publicPath: `http://localhost:${PORT}/`,
umdNamedDefine: true
},
plugins: [
new webpack.EnvironmentPlugin([
'NODE_ENV'
]),
new HtmlWebpackPlugin()
],
resolve: {
extensions: [
'',
'.js'
],
fallback: [
path.join (__dirname, 'src')
],
root: __dirname
}
};