Skip to content

Commit 320efb7

Browse files
authoredAug 26, 2022
feat(gatsby-link,gatsby-plugin-image,gatsby-script): Client export directive (#36470)

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed
 

‎packages/gatsby-link/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"sideEffects": false,
1717
"scripts": {
1818
"build": "npm-run-all --npm-path npm -s build:cjs build:esm",
19+
"postbuild": "prepend-directive --files=dist/index.js,dist/index.modern.mjs --directive=\"client export\"",
1920
"build:cjs": "microbundle -f cjs --jsx React.createElement --generateTypes false -i src/index-cjs.js -o dist/index.js",
2021
"build:esm": "microbundle -f modern --jsx React.createElement --generateTypes false -o dist/index.mjs",
2122
"watch": "npm-run-all --npm-path npm -p watch:cjs watch:esm",
@@ -34,7 +35,8 @@
3435
"cross-env": "^7.0.3",
3536
"del-cli": "^5.0.0",
3637
"microbundle": "^0.15.0",
37-
"npm-run-all": "^4.1.5"
38+
"npm-run-all": "^4.1.5",
39+
"prepend-directive": "^1.0.3"
3840
},
3941
"peerDependencies": {
4042
"@gatsbyjs/reach-router": "^1.3.5",

‎packages/gatsby-plugin-image/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "2.23.0-next.0",
44
"scripts": {
55
"build": "npm-run-all --npm-path npm -s clean -p build:*",
6+
"postbuild": "prepend-directive --files=dist/gatsby-image.browser.js,dist/gatsby-image.browser.modern.js --directive=\"client export\"",
67
"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",
78
"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",
89
"build:server": "microbundle -f cjs,es --jsx React.createElement --jsxFragment React.Fragment --define SERVER=true",
@@ -59,6 +60,7 @@
5960
"microbundle": "^0.15.0",
6061
"npm-run-all": "^4.1.5",
6162
"postcss": "^8.2.9",
63+
"prepend-directive": "^1.0.3",
6264
"semver": "^7.3.7",
6365
"terser": "^5.3.8",
6466
"typescript": "^4.7.4"

‎packages/gatsby-script/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"sideEffects": false,
1717
"scripts": {
1818
"build": "microbundle -f cjs,modern --jsx React.createElement",
19+
"postbuild": "prepend-directive --files=dist/index.js,dist/index.modern.mjs --directive=\"client export\"",
1920
"watch": "microbundle watch -f cjs,modern --jsx React.createElement --no-compress",
2021
"prepare": "cross-env NODE_ENV=production npm run clean && npm run build",
2122
"clean": "del-cli dist/*"
@@ -25,6 +26,7 @@
2526
"cross-env": "^7.0.3",
2627
"del-cli": "^5.0.0",
2728
"microbundle": "^0.15.0",
29+
"prepend-directive": "^1.0.3",
2830
"typescript": "^4.7.4"
2931
},
3032
"peerDependencies": {

‎yarn.lock

+7
Original file line numberDiff line numberDiff line change
@@ -19553,6 +19553,13 @@ prelude-ls@~1.1.2:
1955319553
version "1.1.2"
1955419554
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
1955519555

19556+
prepend-directive@^1.0.3:
19557+
version "1.0.3"
19558+
resolved "https://registry.yarnpkg.com/prepend-directive/-/prepend-directive-1.0.3.tgz#c4efc08b65f9245c66d35d223be16e1945b0e36c"
19559+
integrity sha512-2z115QLE7yxRp172Vv9hM2fWhtI5UtaQFDj+JnyzQxIZ7Wj/7ohrtriEIqXqgLOHsXUf08rjLd+kFUVCUJskPg==
19560+
dependencies:
19561+
fs-extra "^10.1.0"
19562+
1955619563
prepend-http@^1.0.1:
1955719564
version "1.0.4"
1955819565
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"

0 commit comments

Comments
 (0)
Please sign in to comment.