Skip to content

Commit

Permalink
feat: use API add from env
Browse files Browse the repository at this point in the history
  • Loading branch information
mukuljainx committed May 20, 2021
1 parent e607a34 commit e9d2095
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 30 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test:watch": "jest --watch",
"start": "webpack serve --progress --config webpack.dev.ts",
"test:e2e": "cypress open",
"build": "webpack --progress --config webpack.prod.ts --mode=production"
"build": "NODE_ENV=production webpack --progress --config webpack.prod.ts --mode=production"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/apps/externalAppShell/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const ExternalAppShell = ({
}: IProps) => {
const { render } = useAnimationEndRender({ instanceId });
const status = useScript(
`http://${process.env.API}/api/manager/assests/${data.appId}/main.js`,
`${process.env.API}/api/manager/assests/${data.appId}/main.js`,
true
);
console.log(data.options);
Expand Down
2 changes: 1 addition & 1 deletion src/auth/userInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const Auth = ({ user }: IProps) => {
iconProps={{ iconName: "AddFriend" }}
allowDisabledFocus
onClick={() => {
window.location.href = `http://${process.env.API}/auth/google`;
window.location.href = `${process.env.API}/auth/google`;
}}
>
Continue with Google
Expand Down
2 changes: 1 addition & 1 deletion src/utils/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ axios.interceptors.request.use((config) => {

return {
...config,
baseURL: `http://${process.env.API}/api`,
baseURL: `${process.env.API}/api`,
headers: {
...config.headers,
Authorization: token,
Expand Down
18 changes: 1 addition & 17 deletions webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const config = {
test: /\.(png|jpg|gif)($|\?)/,
loader: "url-loader",
options: {
limit: 8192,
limit: 4096,
},
},
{
Expand All @@ -74,22 +74,6 @@ const config = {
},
],
},
externals: {
// react: {
// root: "React",
// commonjs2: "react",
// commonjs: "react",
// amd: "react",
// umd: "react",
// },
// "react-dom": {
// root: "ReactDOM",
// commonjs2: "react-dom",
// commonjs: "react-dom",
// amd: "react-dom",
// umd: "react-dom",
// },
},
};

module.exports = config;
15 changes: 6 additions & 9 deletions webpack.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,9 @@ const config = {
path: path.resolve("./dist"),
},
optimization: {
usedExports: true,
splitChunks: {
cacheGroups: {
vendor: {
// just need to exclude these they will created by webpack as other chunk
test: /.?[\\/]node_modules[\\/](?!(react-pdf|pdfjs-dist|react-table|d3)).*?/,
name: "vendors",
chunks: "all",
},
},
// include all types of chunks
chunks: "all",
},
},

Expand All @@ -51,6 +44,10 @@ const config = {
openAnalyzer: true,
}),
],
externals: {
react: "React",
"react-dom": "ReactDOM",
},
};

module.exports = merge(common, config);

0 comments on commit e9d2095

Please sign in to comment.