forked from yusukeshib/react-pullrefresh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.test.js
76 lines (74 loc) · 1.51 KB
/
webpack.config.test.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
'use strict'
const path = require('path')
const webpack = require('webpack')
const fs = require('fs')
const srcPath = __dirname
const port = 8080
const publicPath = '/'
module.exports = {
entry: [
'./test/index.js'
],
devtool: 'source-map',
plugins: [
new webpack.LoaderOptionsPlugin({ debug: true }),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.HotModuleReplacementPlugin()
],
output: {
path: __dirname,
filename: 'built.js',
publicPath: publicPath
},
devServer: {
contentBase: '.',
historyApiFallback: true,
headers: { 'Access-Control-Allow-Origin': '*' },
hot: true,
inline: true,
port: port,
publicPath: publicPath,
noInfo: false
},
resolve: {
extensions: ['.js', 'jsx'],
alias: {
'react-pullrefresh': fs.realpathSync(path.resolve('src'))
}
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
enforce: 'pre',
include: srcPath,
loader: 'eslint-loader'
},
{
test: /\.(css)$/,
loader: 'style-loader!css-loader'
},
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
babelrc: false,
presets: [
'es2017',
'react',
'stage-1'
],
env: {
'development': {
'sourceMaps': 'inline'
}
},
plugins: [
'transform-regenerator'
]
}
}
]
}
}