-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.config.js
41 lines (36 loc) · 1.07 KB
/
webpack.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
38
39
40
41
/** ****************************************************************************
* A common webpack configuration.
**************************************************************************** */
require('dotenv').config({ silent: true });
const webpack = require('webpack');
const appConfig = require('@flumens/webpack-config');
const CopyPlugin = require('copy-webpack-plugin');
const required = [
'APP_BACKEND_CLIENT_ID',
'APP_BACKEND_CLIENT_PASS',
'APP_OS_MAP_KEY',
'APP_MAPBOX_MAP_KEY',
'APP_SENTRY_KEY',
];
const development = {
APP_TRAINING: '',
APP_MANUAL_TESTING: '',
APP_BACKEND_URL: '',
APP_BACKEND_INDICIA_URL: '',
};
appConfig.plugins.unshift(
new webpack.EnvironmentPlugin(required),
new webpack.EnvironmentPlugin(development)
);
// For capacitor sqlite
appConfig.resolve.fallback = { crypto: false };
appConfig.plugins.push(
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
new CopyPlugin({
patterns: [
{ from: 'node_modules/sql.js/dist/sql-wasm.wasm', to: 'assets' },
],
})
);
module.exports = appConfig;