Skip to content

Commit

Permalink
(feat) Upgrade React Spectrum and fix CSS loading error (#778)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher authored Oct 3, 2023
1 parent 0f2bf37 commit b56cd42
Show file tree
Hide file tree
Showing 6 changed files with 546 additions and 474 deletions.
9 changes: 8 additions & 1 deletion packages/framework/esm-framework/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ module.exports = (env) => ({
use: "swc-loader",
},
{
test: /\.s?css$/,
test: /\.css$/,
use: [
{ loader: require.resolve("style-loader") },
{ loader: require.resolve("css-loader") },
],
},
{
test: /\.scss$/,
use: [
{ loader: require.resolve("style-loader") },
{ loader: require.resolve("css-loader") },
Expand Down
8 changes: 4 additions & 4 deletions packages/framework/esm-styleguide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"dependencies": {
"@carbon/charts": "^1.12.0",
"@carbon/react": "^1.37.0",
"@internationalized/date": "^3.2.0",
"@react-spectrum/datepicker": "^3.5.0",
"@react-spectrum/provider": "^3.7.1",
"@react-spectrum/theme-default": "^3.5.1",
"@internationalized/date": "^3.5.0",
"@react-spectrum/datepicker": "^3.8.0",
"@react-spectrum/provider": "^3.9.0",
"@react-spectrum/theme-default": "^3.5.6",
"d3": "^7.8.0",
"lodash-es": "^4.17.21"
},
Expand Down
10 changes: 9 additions & 1 deletion packages/framework/esm-styleguide/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ module.exports = (env) => ({
module: {
rules: [
{
test: /\.s?[ac]ss$/i,
test: /\.css$/i,
use: [
{ loader: MiniCssExtractPlugin.loader },
"css-loader",
{ loader: require.resolve("postcss-loader") },
],
},
{
test: /\.s[ac]ss$/i,
use: [
{ loader: MiniCssExtractPlugin.loader },
"css-loader",
Expand Down
11 changes: 10 additions & 1 deletion packages/shell/esm-app-shell/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,17 @@ module.exports = (env, argv = {}) => {
],
},
{
test: /\.s?css$/,
test: /\.css$/,
exclude: [/openmrs-esm-styleguide\.css$/],
use: [
isProd
? { loader: require.resolve(MiniCssExtractPlugin.loader) }
: { loader: require.resolve("style-loader") },
{ loader: require.resolve("css-loader") },
],
},
{
test: /\.s[ac]ss$/,
use: [
isProd
? { loader: require.resolve(MiniCssExtractPlugin.loader) }
Expand Down
4 changes: 2 additions & 2 deletions packages/tooling/openmrs/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ export async function runBuild(args: BuildArgs) {

return await new Promise<void>((resolve, reject) => {
compiler.run((err, stats) => {
if (err) {
reject(err);
if (err || stats?.hasErrors()) {
reject(err ?? stats?.compilation.errors);
} else {
stats &&
console.log(
Expand Down
Loading

0 comments on commit b56cd42

Please sign in to comment.