-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.cjs
More file actions
31 lines (26 loc) · 932 Bytes
/
webpack.config.cjs
File metadata and controls
31 lines (26 loc) · 932 Bytes
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
const webpack = require('webpack');
const isCI = require('is-ci');
const { merge } = require('webpack-merge');
const { version } = require('./package.json');
const isDev = process.env.NODE_ENV === 'development' && !isCI;
const cliApiDomain = isDev ? 'localhost' : 'cli-api.exlint.io';
const cliApiUrl = isDev ? `http://${cliApiDomain}:4000` : `https://${cliApiDomain}`;
const dashboardUrl = isDev ? 'http://localhost:8080' : 'https://app.exlint.io';
/**
* @type { import('webpack').Configuration }
*/
const configuration = {
plugins: [
new webpack.DefinePlugin({
__CLI_API_DOMAIN__: JSON.stringify(cliApiDomain),
__CLI_API_URL__: JSON.stringify(cliApiUrl),
__DASHBOARD_URL__: JSON.stringify(dashboardUrl),
__VERSION__: JSON.stringify(version),
}),
],
experiments: {
topLevelAwait: true,
},
};
const mergedConfiguration = (options) => merge(options, configuration);
module.exports = mergedConfiguration;