-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathwebpack.common.js
39 lines (35 loc) · 1.12 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
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),
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),
SENTRY_DSN: JSON.stringify(process.env.SENTRY_DSN),
}),
],
}
}