mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +08:00
feat: add hubspot embed script
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<%= htmlWebpackPlugin.options.hubspotScript %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -12,6 +12,13 @@ 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>`;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = function (webpackConfig) {
|
||||
const config = getNxWebpackConfig(webpackConfig);
|
||||
|
||||
@@ -175,6 +182,7 @@ module.exports = function (webpackConfig) {
|
||||
), //favicon path
|
||||
template: path.resolve(__dirname, './src/template.html'),
|
||||
publicPath: '/',
|
||||
hubspotScript: generateHubspotScript(),
|
||||
}),
|
||||
new Style9Plugin(),
|
||||
isProd &&
|
||||
|
||||
Reference in New Issue
Block a user