Skip to content

Commit

Permalink
webpack fix for prod (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
GurinderRawala committed Aug 27, 2024
1 parent 044a720 commit 0fcbc58
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 27 deletions.
27 changes: 4 additions & 23 deletions public/microfrontends/fn_dashboard/index.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
<!doctype html>
<html lang="en">
<head id="qiankun-head">
<title>CodeRabbit Micro-frontend</title>
<base href="/" />
</head>

<body class="theme-light app-grafana">
<div id="grafanaRoot"></div>
<script nonce="">
window.fnData = {
<!doctype html><html lang="en"><head><title>CodeRabbit Micro-frontend</title><base href="/"/></head><body class="theme-light app-grafana"><div id="grafanaRoot"></div><script nonce="">window.fnData = {
themePaths: {
light: '../../../public/build/grafana.light.c4a2b9d7041eee54c2c5.css',
dark: '../../../public/build/grafana.dark.c9affdc3c424b7fe7178.css',
light: '../../../public/build/grafana.light.919a2bf9d8d520de3b33.css',
dark: '../../../public/build/grafana.dark.341ec2d9d1b948e9351a.css',
},
};
</script>


<script nonce="" src="../../../public/build/runtime~fn_dashboard.512db17f9b8f66891b2c.js" type="text/javascript"></script>

<script nonce="" src="../../../public/build/fn_dashboard.bb3af0c3464201961162.js" type="text/javascript"></script>

</body>
</html>
};</script><script nonce="" src="../../../public/build/runtime.e887ee410b04048b93bb.js"></script><script nonce="" src="../../../public/build/9767.5d11687466af2e323217.js"></script><script nonce="" src="../../../public/build/6510.3c0ff62c6be1dabb1076.js"></script><script nonce="" src="../../../public/build/736.a7c1a735dcc89552444b.js"></script><script nonce="" src="../../../public/build/3880.2244b9f025ace4c25949.js"></script><script nonce="" src="../../../public/build/4000.3d7b8c06970ead030ece.js"></script><script nonce="" src="../../../public/build/4161.5d0fee404a7937384676.js"></script><script nonce="" src="../../../public/build/6406.78c224d72f4c255d0cd7.js"></script><script nonce="" src="../../../public/build/2253.8557a4046de15bdfe5f5.js"></script><script nonce="" src="../../../public/build/8200.4f6046fffc2bc4c0e99c.js"></script><script nonce="" src="../../../public/build/9334.3f47b65f852b47933f4e.js"></script><script nonce="" src="../../../public/build/5670.1b6e072b061193be2b12.js"></script><script nonce="" src="../../../public/build/2954.fb78b2a299991850d30f.js"></script><script nonce="" src="../../../public/build/8629.d45179333f04e81d2640.js"></script><script nonce="" src="../../../public/build/5446.061625ba71ddd711a34f.js"></script><script nonce="" src="../../../public/build/fn_dashboard.51fd59d60567e892f3c0.js"></script></body></html>
2 changes: 1 addition & 1 deletion public/views/index-microfrontend-template.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!doctype html>
<html lang="en">
<head id="qiankun-head">
<head>
<title>CodeRabbit Micro-frontend</title>
<base href="/" />
</head>
Expand Down
1 change: 0 additions & 1 deletion scripts/webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
target: 'web',
entry: {
app: './public/app/index.ts',
fn_dashboard: './public/app/fn_dashboard.ts',
},
output: {
clean: true,
Expand Down
8 changes: 6 additions & 2 deletions scripts/webpack/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ const { EsbuildPlugin } = require('esbuild-loader');
const { resolveToEsbuildTarget } = require('esbuild-plugin-browserslist');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const { EnvironmentPlugin } = require('webpack');
const WebpackAssetsManifest = require('webpack-assets-manifest');
const { DefinePlugin } = require('webpack');
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const { merge } = require('webpack-merge');

Expand Down Expand Up @@ -95,6 +94,11 @@ module.exports = (env = {}) =>
excludeChunks: ['dark', 'light', 'app'],
}),
new HTMLWebpackCSSChunks(),
new DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development'),
},
}),
new WebpackManifestPlugin({
fileName: path.join(process.cwd(), 'manifest.json'),
filter: (file) => !file.name.endsWith('.map'),
Expand Down

0 comments on commit 0fcbc58

Please sign in to comment.