forked from agrcrobles/react-native-web-workspace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.config.js
More file actions
67 lines (64 loc) · 1.66 KB
/
webpack.dev.config.js
File metadata and controls
67 lines (64 loc) · 1.66 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
const webpack = require('webpack');
const path = require('path');
module.exports = {
devServer: {
contentBase: path.join(__dirname, 'build'),
// enable HMR
port: 3000
},
devtool: 'inline-source-map',
entry: [
path.join(__dirname, './index.js')
],
module: {
rules: [
{
test: /.js$/,
include: [
path.resolve(__dirname, 'index.js'),
path.resolve(__dirname, './node_modules/react-native-vector-icons'),
path.resolve(__dirname, './node_modules/react-native-tab-view'),
path.resolve(__dirname, './node_modules/react-navigation-playground'),
path.resolve(__dirname, './node_modules/components'),
path.resolve(__dirname, './node_modules/react-navigation'),
path.resolve(__dirname, './node_modules/react-native-safe-area-view')
],
use: [
{
loader: 'babel-loader'
}
],
},
{
test: /\.(gif|jpe?g|png|svg)$/,
loader: 'url-loader',
query: { name: '[name].[hash:16].[ext]' }
},
{
test: /\.ttf$/,
loader: "url-loader", // or directly file-loader
include: path.resolve(__dirname, "node_modules/react-native-vector-icons"),
},
]
},
output: {
path: path.join(__dirname, 'build'),
filename: 'bundle.js'
},
plugins: [
new webpack.NamedModulesPlugin(),
new webpack.DefinePlugin({
__DEV__: true,
'process.env': {
NODE_ENV: JSON.stringify('development')
},
})
],
resolve: {
extensions: [ '.web.js', '.js' ],
symlinks: false,
alias: {
'react-native': 'react-native-web'
}
}
};