Skip to content

Update build scripts to work with exports #5708

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

Merged
merged 5 commits into from
Nov 8, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .changeset/spotty-ducks-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
"@firebase/analytics-compat": patch
"@firebase/analytics": patch
"@firebase/app-check-compat": patch
"@firebase/app-check": patch
"@firebase/app-compat": patch
"@firebase/app": patch
"@firebase/auth-compat": patch
"@firebase/auth": patch
"@firebase/component": patch
"@firebase/database-compat": patch
"@firebase/database": patch
"firebase": patch
"@firebase/firestore-compat": patch
"@firebase/firestore": patch
"@firebase/functions-compat": patch
"@firebase/functions": patch
"@firebase/installations-compat": patch
"@firebase/installations": patch
"@firebase/logger": patch
"@firebase/messaging-compat": patch
"@firebase/messaging": patch
"@firebase/performance-compat": patch
"@firebase/performance": patch
"@firebase/remote-config-compat": patch
"@firebase/remote-config": patch
"@firebase/storage-compat": patch
"@firebase/storage": patch
"@firebase/template": patch
"@firebase/util": patch
---

Update build scripts to work with the exports field
1 change: 1 addition & 0 deletions packages/analytics-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/app-check-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/app-check/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
5 changes: 4 additions & 1 deletion packages/app-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
"module": "dist/esm/index.esm2017.js",
"esm5": "dist/esm/index.esm5.js",
"lite": "dist/index.lite.js",
"lite-esm5": "dist/index.lite.esm5.js",
"liteesm5": "dist/index.lite.esm5.js",
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"lite": "./dist/index.lite.js",
"liteesm5": "./dist/index.lite.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
2 changes: 1 addition & 1 deletion packages/app-compat/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const esmBuilds = [
{
input: 'src/index.lite.ts',
output: {
file: pkg['lite-esm5'],
file: pkg['liteesm5'],
format: 'es',
sourcemap: true
},
Expand Down
1 change: 1 addition & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/auth-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"import": "./dist/esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
2 changes: 2 additions & 0 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"react-native": "./dist/rn/index.js",
"cordova": "./dist/cordova/index.esm5.js",
"webworker": "./dist/index.webworker.esm5.js",
"esm5": "./dist/esm5/index.js",
"default": "./dist/esm2017/index.js"
},
"./internal": {
Expand All @@ -28,6 +29,7 @@
},
"react-native": "./dist/rn/internal.js",
"cordova": "./dist/cordova/internal.js",
"esm5": "./dist/esm5/internal.js",
"default": "./dist/esm2017/internal.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/database-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"import": "./dist/node-esm/index.js",
"require": "./dist/index.js"
},
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./standalone": {
Expand Down
2 changes: 1 addition & 1 deletion packages/database-compat/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const cjsBuilds = [
plugins: [
...es5BuildPlugins,
resolveModule({
mainFields: ['standalone'],
exportConditions: ['standalone'],
preferBuiltins: true
}),
commonjs()
Expand Down
2 changes: 2 additions & 0 deletions packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"import": "./dist/node-esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm5.js",
"standalone": "./dist/index.standalone.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase/compat/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ const completeBuilds = [
plugins: [
sourcemaps(),
resolveModule({
mainFields: ['lite-esm5', 'esm5', 'module']
exportConditions: ['liteesm5', 'esm5']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is liteesm5 missing a dash here?

Copy link
Member Author

@Feiyang1 Feiyang1 Nov 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it's intentional to not include a dash here because rollup doesn't seem to like it.

}),
typescriptPluginCDN,
json(),
Expand All @@ -265,7 +265,7 @@ const completeBuilds = [
plugins: [
sourcemaps(),
resolveModule({
mainFields: ['lite', 'module', 'main']
exportConditions: ['lite']
}),
rollupTypescriptPlugin({
typescript,
Expand Down
1 change: 1 addition & 0 deletions packages/firestore-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"require": "./dist/index.node.cjs.js"
},
"react-native": "./dist/index.rn.js",
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
2 changes: 2 additions & 0 deletions packages/firestore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"import": "./dist/index.node.mjs"
},
"react-native": "./dist/index.rn.js",
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./lite": {
Expand All @@ -62,6 +63,7 @@
"import": "./dist/lite/index.node.mjs"
},
"react-native": "./dist/lite/index.rn.esm2017.js",
"esm5": "./dist/lite/index.browser.esm5.js",
"default": "./dist/lite/index.browser.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/functions-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"import": "./dist/node-esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"import": "./dist/esm-node/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/installations-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/installations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/messaging-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/messaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
".": {
"browser": "./dist/esm/index.esm2017.js",
"module": "./dist/esm/index.esm2017.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/index.cjs.js"
},
"./sw": "./dist/index.sw.esm2017.js",
Expand Down
1 change: 1 addition & 0 deletions packages/performance-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/performance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/remote-config-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/remote-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/storage-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"exports": {
".": {
"require": "./dist/index.cjs.js",
"esm5": "./dist/esm/index.esm5.js",
"default": "./dist/esm/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
3 changes: 2 additions & 1 deletion packages/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"node": {
"import": "./dist/node-esm/index.node.esm.js",
"default": "./dist/index.node.cjs.js"
},
},
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"import": "./dist/node-esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"import": "./dist/node-esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions packages/webchannel-wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"exports": {
".": {
"require": "./dist/index.js",
"esm5": "./dist/index.esm.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
Expand Down