Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gatsby-link,gatsby-plugin-image,gatsby-script): Client export directive #36470

Merged
merged 2 commits into from Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/gatsby-link/package.json
Expand Up @@ -16,6 +16,7 @@
"sideEffects": false,
"scripts": {
"build": "npm-run-all --npm-path npm -s build:cjs build:esm",
"postbuild": "prepend-directive --files=dist/index.js,dist/index.modern.mjs --directive=\"client export\"",
"build:cjs": "microbundle -f cjs --jsx React.createElement --generateTypes false -i src/index-cjs.js -o dist/index.js",
"build:esm": "microbundle -f modern --jsx React.createElement --generateTypes false -o dist/index.mjs",
"watch": "npm-run-all --npm-path npm -p watch:cjs watch:esm",
Expand All @@ -34,7 +35,8 @@
"cross-env": "^7.0.3",
"del-cli": "^5.0.0",
"microbundle": "^0.15.0",
"npm-run-all": "^4.1.5"
"npm-run-all": "^4.1.5",
"prepend-directive": "^1.0.3"
},
"peerDependencies": {
"@gatsbyjs/reach-router": "^1.3.5",
Expand Down
2 changes: 2 additions & 0 deletions packages/gatsby-plugin-image/package.json
Expand Up @@ -3,6 +3,7 @@
"version": "2.23.0-next.0",
"scripts": {
"build": "npm-run-all --npm-path npm -s clean -p build:*",
"postbuild": "prepend-directive --files=dist/gatsby-image.browser.js,dist/gatsby-image.browser.modern.js --directive=\"client export\"",
"build:gatsby-node": "tsc --jsx react --downlevelIteration true --skipLibCheck true --esModuleInterop true --outDir dist/ src/gatsby-node.ts src/babel-plugin-parse-static-images.ts src/resolver-utils.ts src/types.d.ts -d --declarationDir dist/src",
"build:gatsby-ssr": "microbundle -i src/gatsby-ssr.tsx -f cjs -o ./[name].js --no-pkg-main --jsx React.createElement --jsxFragment React.Fragment --no-compress --external=common-tags,react --no-sourcemap",
"build:server": "microbundle -f cjs,es --jsx React.createElement --jsxFragment React.Fragment --define SERVER=true",
Expand Down Expand Up @@ -59,6 +60,7 @@
"microbundle": "^0.15.0",
"npm-run-all": "^4.1.5",
"postcss": "^8.2.9",
"prepend-directive": "^1.0.3",
"semver": "^7.3.7",
"terser": "^5.3.8",
"typescript": "^4.7.4"
Expand Down
2 changes: 2 additions & 0 deletions packages/gatsby-script/package.json
Expand Up @@ -16,6 +16,7 @@
"sideEffects": false,
"scripts": {
"build": "microbundle -f cjs,modern --jsx React.createElement",
"postbuild": "prepend-directive --files=dist/index.js,dist/index.modern.mjs --directive=\"client export\"",
"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/*"
Expand All @@ -25,6 +26,7 @@
"cross-env": "^7.0.3",
"del-cli": "^5.0.0",
"microbundle": "^0.15.0",
"prepend-directive": "^1.0.3",
"typescript": "^4.7.4"
},
"peerDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Expand Up @@ -19553,6 +19553,13 @@ prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"

prepend-directive@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/prepend-directive/-/prepend-directive-1.0.3.tgz#c4efc08b65f9245c66d35d223be16e1945b0e36c"
integrity sha512-2z115QLE7yxRp172Vv9hM2fWhtI5UtaQFDj+JnyzQxIZ7Wj/7ohrtriEIqXqgLOHsXUf08rjLd+kFUVCUJskPg==
dependencies:
fs-extra "^10.1.0"

prepend-http@^1.0.1:
version "1.0.4"
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
Expand Down