mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-23 21:06:22 +08:00
feat: affine-embed-header
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<%= htmlWebpackPlugin.options.hubspotScript %>
|
||||
<%= htmlWebpackPlugin.options.embedHeaderScript %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -11,13 +11,7 @@ const TerserPlugin = require('terser-webpack-plugin');
|
||||
const Style9Plugin = require('style9/webpack');
|
||||
|
||||
const enableBundleAnalyzer = process.env.BUNDLE_ANALYZER;
|
||||
|
||||
function generateHubspotScript() {
|
||||
const hubspotApiSecret = process.env.HUBSPOT_API_SECRET;
|
||||
if (hubspotApiSecret) {
|
||||
return `<script type="text/javascript" id="hs-script-loader" async defer src="//js-na1.hs-scripts.com/${hubspotApiSecret}.js"></script>`;
|
||||
}
|
||||
}
|
||||
const embedHeaderScript = process.env.AFFINE_EMBED_HEADER;
|
||||
|
||||
module.exports = function (webpackConfig) {
|
||||
const config = getNxWebpackConfig(webpackConfig);
|
||||
@@ -185,7 +179,7 @@ module.exports = function (webpackConfig) {
|
||||
), //favicon path
|
||||
template: path.resolve(__dirname, './src/template.html'),
|
||||
publicPath: '/',
|
||||
hubspotScript: generateHubspotScript(),
|
||||
embedHeaderScript,
|
||||
}),
|
||||
new Style9Plugin(),
|
||||
isProd &&
|
||||
|
||||
Reference in New Issue
Block a user