-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreact.config.js
37 lines (31 loc) · 1.27 KB
/
preact.config.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
32
33
34
35
36
37
const dotenv = require('dotenv')
dotenv.config()
const path = require('path')
const webpack = require('webpack')
const CopyWebpackPlugin = require('copy-webpack-plugin')
export default config => {
// https://github.com/firebase/firebaseui-web/issues/722#issuecomment-694277747
config.module.rules.push({
test: /esm\.js$/,
loader: 'string-replace-loader',
include: path.resolve('node_modules/firebaseui/dist'),
query: {
search: "import * as firebase from 'firebase/app';",
replace: "import firebase from 'firebase/app';"
}
})
config.plugins.push(new CopyWebpackPlugin([{ context: `${__dirname}/src/assets`, from: 'robots.txt' }]))
config.plugins.push(new CopyWebpackPlugin([{ context: `${__dirname}/src/assets`, from: 'browserconfig.xml' }]))
config.plugins.push(
new webpack.DefinePlugin({
API_KEY: JSON.stringify(process.env.API_KEY),
AUTH_DOMAIN: JSON.stringify(process.env.AUTH_DOMAIN),
DATABASE_URL: JSON.stringify(process.env.DATABASE_URL),
PROJECT_ID: JSON.stringify(process.env.PROJECT_ID),
STORAGE_BUCKET: JSON.stringify(process.env.STORAGE_BUCKET),
MESSAGING_SENDER_ID: JSON.stringify(process.env.MESSAGING_SENDER_ID),
APP_ID: JSON.stringify(process.env.APP_ID)
})
)
return config
}