-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
52 lines (50 loc) · 1.45 KB
/
webpack.common.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
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = {
entry: {
entry: "./index.js",
},
output: {
path: path.join(__dirname, "/dist"),
filename: "index.bundle.js",
},
module: {
rules: [
{
test: /\.(js|jsx|ts|tsx)$/,
exclude: /node_modules[/\\](?!react-native-vector-icons)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: [["@babel/plugin-proposal-class-properties", {loose: true}]],
},
},
},
{
test: /\.(jpg|jpeg|png|woff|woff2|eot|ttf|svg)$/,
type: "asset",
},
],
},
resolve: {
alias: {
"react-native": "react-native-web",
"@storybook/react-native": "@storybook/react",
"react-native-gesture-handler": "react-native-web",
screens: path.resolve(__dirname, "src", "screens"),
components: path.resolve(__dirname, "src", "components"),
navigation: path.resolve(__dirname, "src", "navigation"),
services: path.resolve(__dirname, "src", "services"),
utils: path.resolve(__dirname, "src", "utils"),
assets: path.resolve(__dirname, "src", "assets"),
},
modules: [path.join(__dirname, "./node_modules")],
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
plugins: [
new CopyWebpackPlugin({
patterns: [{from: "static"}],
}),
],
};