forked from cerc-io/laconic-wallet-web
Nabarun
6f174c6e0c
Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675) Co-authored-by: IshaVenikar <ishavenikar7@gmail.com> Reviewed-on: cerc-io/laconic-wallet-web#10 Co-authored-by: Nabarun <nabarun@deepstacksoft.com> Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
54 lines
1.4 KiB
JavaScript
54 lines
1.4 KiB
JavaScript
// TODO: Use Typescript
|
|
const webpack = require('webpack')
|
|
|
|
module.exports = function override(config, env) {
|
|
config.module.rules.push({
|
|
test: /\.js$/,
|
|
exclude: /node_modules[/\\](?!react-native-vector-icons)/,
|
|
use: {
|
|
loader: "babel-loader",
|
|
options: {
|
|
// Disable reading babel configuration
|
|
babelrc: false,
|
|
configFile: false,
|
|
|
|
// The configuration for compilation
|
|
presets: [
|
|
["@babel/preset-env", { useBuiltIns: "usage", "corejs": "3" }],
|
|
"@babel/preset-react",
|
|
"@babel/preset-flow",
|
|
"@babel/preset-typescript",
|
|
],
|
|
plugins: [
|
|
"@babel/plugin-proposal-class-properties",
|
|
"@babel/plugin-proposal-object-rest-spread",
|
|
"@babel/plugin-transform-modules-commonjs"
|
|
]
|
|
}
|
|
}
|
|
});
|
|
|
|
config.plugins.push(
|
|
new webpack.ProvidePlugin({
|
|
Buffer: ["buffer", "Buffer"],
|
|
})
|
|
)
|
|
|
|
config.module.rules.push({
|
|
test: /\.(jpg|png|woff|woff2|eot|ttf|svg)$/,
|
|
type: 'asset/resource'
|
|
})
|
|
|
|
config.resolve.fallback = {
|
|
crypto: require.resolve("crypto-browserify"),
|
|
stream: require.resolve("stream-browserify"),
|
|
http: require.resolve('stream-http'),
|
|
https: require.resolve('https-browserify'),
|
|
url: false
|
|
}
|
|
|
|
config.resolve.alias['react-native$'] = require.resolve('react-native-web');
|
|
|
|
return config;
|
|
};
|