{"name":"gatsby-script","description":"An enhanced script component for Gatsby sites with support for various loading strategies","version":"2.15.0-next.0","author":{"name":"Ty Hopp","email":"ty.hopp@gatsbyjs.com"},"bugs":{"url":"https://github.com/gatsbyjs/gatsby/issues"},"source":"src/index.ts","main":"dist/index.js","module":"dist/index.modern.mjs","types":"dist/index.d.ts","sideEffects":false,"scripts":{"build":"microbundle -f cjs,modern --jsx React.createElement && tsc --emitDeclarationOnly --declaration --declarationDir dist","postbuild":"prepend-directive --files=dist/index.js,dist/index.modern.mjs --directive=\"use client\"","watch":"microbundle watch -f cjs,modern --jsx React.createElement --no-compress","prepare":"cross-env NODE_ENV=production npm run clean && npm run build","clean":"del-cli dist/*"},"devDependencies":{"@gatsbyjs/reach-router":"^2.0.1","@testing-library/react":"^11.2.7","cross-env":"^7.0.3","del-cli":"^5.1.0","microbundle":"^0.15.1","prepend-directive":"^1.1.0","typescript":"^5.1.6"},"peerDependencies":{"@gatsbyjs/reach-router":"^2.0.0","react":"^18.0.0 || ^0.0.0","react-dom":"^18.0.0 || ^0.0.0"},"engines":{"node":">=18.0.0"},"homepage":"https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-script#readme","keywords":["gatsby"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/gatsbyjs/gatsby.git","directory":"packages/gatsby-script"},"gitHead":"17baffb1fb7333b8a45745b7d9a0bb4bb2f0f491","readmeFilename":"README.md","_id":"gatsby-script@2.15.0-next.0","_nodeVersion":"20.11.1","_npmVersion":"lerna/3.22.1/node@v20.11.1+arm64 (darwin)","dist":{"integrity":"sha512-hzM1xpdBFYtE0UYQV+VaW+nuLBE05jFeiT8DREiSDx3Xev2AkU5DOHLiFpjkMIfLn/MG27vDmMXSwFqSx65ZQA==","shasum":"0b38d4c52df5c0e3c221243f5466e7793fd0695f","tarball":"http://registry-npm.ywwl.com/gatsby-script/download/gatsby-script-2.15.0-next.0.tgz","fileCount":12,"unpackedSize":52476,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdvhV4eaqlYS4a7EWLzf1BaWV1SdwZb8zzAiOFOX3LggIhAOf6IqBA4jiogsqVpe0ofkAi6dZdB3fZQRYShSaBZ5gh"}],"size":14881,"noattachment":false,"key":"/gatsby-script/-/gatsby-script-2.15.0-next.0.tgz"},"_npmUser":{"name":"serhalp-netlify","email":"philippe.serhal@netlify.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-script_2.15.0-next.0_1731006035727_0.5356320708729432"},"_hasShrinkwrap":false,"readme":"# gatsby-script\n\nAn enhanced script component for Gatsby sites with support for various loading strategies.\n\nYou do not need to install this package directly, it is available in the main Gatsby package since `gatsby@4.15.0`.\n\nSee the [documentation](https://gatsby.dev/gatsby-script) for full details.\n\n## Usage\n\n```tsx\nimport * as React from \"react\"\nimport { Script, ScriptStrategy } from \"gatsby\" // Re-exported from core\n\nconst GTM = `G-XXXXXXXXXX` // Example Google Analytics 4 identifier\n\n// Example script sources for illustration\nconst scripts = {\n  three: \"https://unpkg.com/three@0.139.1/build/three.js\",\n  marked: \"https://cdn.jsdelivr.net/npm/marked/marked.min.js\",\n  gtag: `https://www.googletagmanager.com/gtag/js?id=${GTM}`,\n}\n\n// Strategy prop is optional, defaults to post-hydrate\nfunction IndexPage() {\n  return (\n    <main>\n      <h1>Script component example</h1>\n      <Script src={scripts.three} strategy={ScriptStrategy.postHydrate} />\n      <Script src={scripts.marked} strategy={ScriptStrategy.idle} />\n      <Script\n        src={scripts.gtag}\n        strategy={ScriptStrategy.offMainThread}\n        forward={[`gtag`]}\n      />\n      <Script id=\"gtag-config\" strategy={ScriptStrategy.offMainThread}>\n        {`\n          // Example configuration of Google Analytics for use in Partytown\n          window.dataLayer = window.dataLayer || [];\n          function gtag(){dataLayer.push(arguments)};\n          gtag('js', new Date());\n          gtag('config', ${GTM}, { send_page_view: false })\n        `}\n      </Script>\n      <Script\n        id=\"my-unique-id\"\n        dangerouslySetInnerHTML={{ __html: `alert('Hello world')` }}\n      />\n      <Script id=\"my-unique-id-2\">{`alert('Hello world')`}</Script>\n    </main>\n  )\n}\n\nexport default IndexPage\n```\n","publish_time":1731006035983,"maintainers":[{"name":"mlgualtieri-gatsby","email":"mike.gualtieri@netlify.com"},{"name":"serhalp-netlify","email":"philippe.serhal@netlify.com"},{"name":"kathmbeck","email":"katherine.beck@netlify.com"},{"name":"pieh","email":"misiek.piechowiak@gmail.com"},{"name":"tylerbarnes","email":"tyler@known.design"},{"name":"daniellewgatsby","email":"daniel.lew@gatsbyjs.com"},{"name":"fk","email":"sechskilo@gmail.com"}],"_cnpm_publish_time":1731006035983,"dist-tags":{"alpha-9689ff":"1.8.0-alpha-9689ff.25","alpha-a5-peer":"1.8.0-alpha-a5-peer.53","alpha-gatsby-script":"1.0.0-alpha-gatsby-script.20251","alpha-gatsby-script-proxy-2":"1.0.0-alpha-gatsby-script-proxy-2.20252","alpha-transformer-json":"2.0.0-alpha-transformer-json.20740","alpha-v5":"2.0.0-alpha-v5.d20221012t101120.57","drupal-proxyurl":"2.0.0-alpha-drupal-proxyurl.14","drupal-self-reference":"1.3.0-alpha-drupal-self-reference.18","latest":"2.16.0","latest-v4":"1.10.0","next":"2.17.0-next.0","preview-gh-api":"1.8.0-alpha-preview-gh-api.26","react19":"2.17.0-react19.0","wp-image-cdn-auth":"1.1.0-alpha-wp-image-cdn-auth.20253"}}