-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-node.js
31 lines (30 loc) · 893 Bytes
/
gatsby-node.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
exports.onCreateWebpackConfig = ({ plugins, actions }, pluginOptions) => {
const {
credentials: {
apiKey,
authDomain,
databaseURL,
projectId,
storageBucket,
messagingSenderId,
appId,
measurementId
}
} = pluginOptions;
actions.setWebpackConfig({
plugins: [
plugins.define({
"process.env": {
FIREBASE_API_KEY: JSON.stringify(apiKey),
FIREBASE_AUTH_DOMAIN: JSON.stringify(authDomain),
FIREBASE_DATABASE_URL: JSON.stringify(databaseURL),
FIREBASE_PROJECT_ID: JSON.stringify(projectId),
FIREBASE_STORAGE_BUCKET: JSON.stringify(storageBucket),
FIREBASE_MESSAGING_SENDER_ID: JSON.stringify(messagingSenderId),
FIREBASE_APP_ID: JSON.stringify(appId),
FIREBASE_MEASUREMENT_ID: JSON.stringify(measurementId)
}
})
]
});
};