Skip to content

Commit

Permalink
updates tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
pirupius committed Aug 1, 2023
1 parent b818e27 commit fc3b02f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@
"resolveJsonModule": true,
"noEmit": true,
"target": "esnext"
}
},
"include": ["src/**/*"],
"exclude": ["src/**/*.test.tsx", "src/**/*.outdated.tsx"]
}
28 changes: 22 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,34 @@ 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])/
: /(node_modules[^\\@openmrs\/esm\-patient\-common\-lib])/;
? /(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",
"@ohri/openmrs-esm-ohri-commons-lib": path.resolve(
__dirname,
"../esm-commons-lib/src/index"
),
"@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 = ["css-loader"];
config.cssRuleConfig.test = /\.css$/;

module.exports = config;

0 comments on commit fc3b02f

Please sign in to comment.