generated from openmrs/openmrs-esm-template-app
-
Notifications
You must be signed in to change notification settings - Fork 13
/
webpack.config.js
35 lines (33 loc) · 1.12 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
const path = require("path");
const config = (module.exports = require("openmrs/default-webpack-config"));
config.scriptRuleConfig.exclude =
path.sep == "/"
? /(node_modules[^\/@openmrs\/esm\-patient\-common\-lib, ^\/@ohri\/openmrs\-esm\-ohri\-commons\-lib])/
: /(node_modules[^\\@openmrs\/esm\-patient\-common\-lib, ^\\@ohri\/openmrs\-esm\-ohri\-commons\-lib])/;
config.overrides.resolve = {
extensions: [".tsx", ".ts", ".jsx", ".js", ".scss"],
alias: {
"@openmrs/esm-framework": "@openmrs/esm-framework/src/internal",
"@openmrs/openmrs-form-engine-lib":
"@openmrs/openmrs-form-engine-lib/src/index",
"@ohri/openmrs-esm-ohri-commons-lib":
"@ohri/openmrs-esm-ohri-commons-lib/src/index",
},
};
config.module = {
rules: [
{
test: /\.(png|jpe?g|gif)$/i,
use: [
{
loader: "file-loader",
},
],
},
],
};
// Overrides to disable CSS Modules for non-scss scripts, this means
// CSS Modules will only be supported with .scss scripts
config.cssRuleConfig.use = ["style-loader", "css-loader"];
config.cssRuleConfig.test = /\.css$/;
module.exports = config;