-
Notifications
You must be signed in to change notification settings - Fork 22
/
example.js
executable file
·67 lines (66 loc) · 1.85 KB
/
example.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
var path = require('path')
var webpack = require('webpack')
var PORT = process.env.PORT || 3003
module.exports = {
mode: 'development',
devtool: 'source-map',
entry: ['./src/index.js'],
context: path.resolve(process.cwd(), 'examples'),
output: {
path: path.resolve(process.cwd(), 'examples/.tmp'),
filename: 'bundle.js',
},
module: {
rules: [
{
test: /\.(es6|js|jsx)$/,
exclude: /(node_modules|vendor)/,
use: {
loader: 'babel-loader',
query: {
plugins: [
[
'react-intl',
{
messagesDir: './examples/src/locales/extracted',
languages: ['en'],
},
'react-intl',
],
[
'react-intl',
{
messagesDir: './examples/src/locales/extracted',
moduleSourceName: './redux-form-validators',
languages: ['en'],
},
'redux-form-validators',
],
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-proposal-function-bind',
'@babel/plugin-transform-runtime',
],
},
},
},
{
test: /\.html$/,
loaders: ['html-loader'],
},
],
},
plugins: [new webpack.HotModuleReplacementPlugin(), new webpack.optimize.ModuleConcatenationPlugin()],
resolve: {
alias: { 'redux-form-validators': path.join(process.cwd(), 'src/index.js') },
extensions: ['.js', '.scss', '.css'],
modules: [path.join(process.cwd(), 'examples'), 'examples', 'node_modules'],
},
devServer: {
contentBase: 'examples',
noInfo: false, // --no-info option
historyApiFallback: true,
hot: true,
inline: true,
port: PORT,
},
}