Skip to content

Commit

Permalink
chore: add custom-webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
JeevaRamu0104 committed Oct 11, 2024
1 parent 6909aca commit e0e161a
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ primary_color="#006DF9"
primary_hover_color="#005ED6"
sidebar_color="#242F48"
[default.endpoints]
api_url="http://localhost:8080"
api_url="https://sandbox.hyperswitch.io"
sdk_url=""
logo_url=""
favicon_url=""
Expand All @@ -18,7 +18,7 @@ test_live_toggle=false
is_live_mode=false
email=false
quick_start=false
audit_trail=false
audit_trail=true
system_metrics=false
sample_data=false
frm=false
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"serve": "node dist/server/server.js",
"prod:start": "webpack serve --config webpack.dev.js",
"build:netlify": "webpack --config webpack.prod.js --env netlifyHosted",
"build:custom": "npm run re:clean && npm run re:build && APP_VERSION=$npm_package_version && webpack --config webpack.custom.js",
"build:prod": "npm run re:clean && npm run re:build && APP_VERSION=$npm_package_version && webpack --config webpack.prod.js",
"build:test": "npm run re:clean && npm run re:build && APP_VERSION=$npm_package_version && webpack --config webpack.prod.js",
"re:build": "rescript",
Expand Down
2 changes: 1 addition & 1 deletion public/hyperswitch/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@

<body>
<!-- SDK Loader Manager (noscript) -->
<script defer type="module" src="/wasm/euclid.js"></script>
<!-- <script defer type="module" src="/wasm/euclid.js"></script> -->
<script defer src="/module.js"></script>
<div id="app"></div>
<script defer onload="clearCookiesWithURLs()" src="/app.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Connectors/ConnectorUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ let taxJarInfo = {
description: "TaxJar is reimagining how businesses manage sales tax compliance. Its cloud-based platform automates the entire sales tax life cycle across all sales channels — from calculations and nexus tracking to reporting and filing.",
}
let nexixpayInfo = {
description : "Nexi's latest generation virtual POS is designed for those who, through a website, want to sell goods or services by managing payments online."
description: "Nexi's latest generation virtual POS is designed for those who, through a website, want to sell goods or services by managing payments online.",
}
let signifydInfo = {
description: "One platform to protect the entire shopper journey end-to-end",
Expand Down
90 changes: 90 additions & 0 deletions webpack.custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const CopyPlugin = require("copy-webpack-plugin");
const tailwindcss = require("tailwindcss");
const webpack = require("webpack");
const path = require("path");
const serverConfig = require("./webpack.server");
let customBuild = (appName = "hyperswitch") => {
const isDevelopment = process.env.NODE_ENV !== "production";
let entryObj = {
app: `./src/entryPoints/HyperSwitchEntry.res.js`,
};
return {
mode: "production",
entry: entryObj,
output: {
path: path.resolve(__dirname, "dist", appName),
clean: true,
publicPath: "/",
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
drop_console: true,
},
},
}),
],
},
module: {
rules: [
{
test: /\.css$/i,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
{
loader: "postcss-loader",
options: {
postcssOptions: {
plugins: [[tailwindcss("./tailwind.config.js")]],
},
},
},
],
},
{
test: /\.ttf$/,
use: ["file-loader"],
},
{
test: /\.js$/,
use: {
loader: "istanbul-instrumenter-loader",
options: { esModules: true },
},
enforce: "post",
exclude: /node_modules|\.spec\.js$/,
},
],
},
plugins: [
new MiniCssExtractPlugin(),
new CopyPlugin({
patterns: [
{ from: `public/${appName}/index.html` },
{ from: `public/${appName}/module.js` },
].filter(Boolean),
}),
new webpack.DefinePlugin({
dashboardAppName: JSON.stringify(appName),
dashboardAppEnv: JSON.stringify(process.env.APP_ENV || "sandbox"),
GIT_COMMIT_HASH: JSON.stringify(process.env.GIT_COMMIT_HASH || ""),
appVersion: JSON.stringify(process.env.APP_VERSION || ""),
}),
isDevelopment && new ReactRefreshWebpackPlugin(),
].filter(Boolean),
};
};

module.exports = (env, _argv) => {
var webpackConfigs = [serverConfig];
webpackConfigs.push(customBuild("hyperswitch", env));
console.log("webpackConfigs", webpackConfigs);
return webpackConfigs;
};

0 comments on commit e0e161a

Please sign in to comment.