forked from getlago/lago-front
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
44 lines (40 loc) · 1.3 KB
/
webpack.common.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
38
39
40
41
42
43
44
require('dotenv').config()
const path = require('path')
const webpack = require('webpack')
const { version } = require('./package.json')
const APP_ENV = process.env.APP_ENV ?? 'development'
module.exports = () => {
return {
entry: path.resolve(__dirname, 'src/index.js'),
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].[chunkhash].js',
},
resolve: {
extensions: ['*', '.ts', '.tsx', '.js'],
alias: {
'~': path.resolve(__dirname, 'src'),
'@mui/styled-engine': path.resolve(__dirname, 'node_modules/@mui/styled-engine-sc'),
},
symlinks: false,
},
plugins: [
new webpack.ProvidePlugin({
React: 'react',
}),
new webpack.DefinePlugin({
APP_ENV: JSON.stringify(APP_ENV),
API_URL: JSON.stringify(process.env.API_URL),
DOMAIN: JSON.stringify(process.env.LAGO_DOMAIN),
APP_VERSION: JSON.stringify(version),
LAGO_OAUTH_PROXY_URL: JSON.stringify(process.env.LAGO_OAUTH_PROXY_URL),
LAGO_DISABLE_SIGNUP: JSON.stringify(process.env.LAGO_DISABLE_SIGNUP),
NANGO_PUBLIC_KEY: JSON.stringify(process.env.NANGO_PUBLIC_KEY),
SENTRY_DSN: JSON.stringify(process.env.SENTRY_DSN),
}),
],
experiments: {
asyncWebAssembly: true,
},
}
}