mozilla / ai-guide

Mozilla AI Guide
Mozilla Public License 2.0
31 stars 27 forks source link

Fix the option name in HtmlBundlerPlugin #1

Closed webdiscus closed 1 year ago

webdiscus commented 1 year ago

Hello @skyfallsin,

I'm the author of the html-bundler-webpack-plugin.

I noticed that the wrong globals option name is being used. The plugin has the data option to pass global variables into all templates.

new HtmlBundlerPlugin({
  entry: {
    entry: "pages/",
  },
  // pass global data into all templates
  data: {
    env: process.env,
  },
}),

The passed data are available in the template, e.g.:

<head>
  <title>{{ env.MY_TITLE  }}</title>
</head>

P.S. the plugin has been updated to the current version 2.12.0.

netlify[bot] commented 1 year ago

Deploy Preview for mozilla-ai-guide ready!

Name Link
Latest commit 1cf772c41424b0790f87537bf5b52d497f42697e
Latest deploy log https://app.netlify.com/sites/mozilla-ai-guide/deploys/6505a54609457a00086157b6
Deploy Preview https://deploy-preview-1--mozilla-ai-guide.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

skyfallsin commented 1 year ago

ty!