Skip to content

Commit

Permalink
update rollup config to handle typescript and js
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuel-musau committed Jan 23, 2025
1 parent 1621cbf commit 4a4a1a1
Show file tree
Hide file tree
Showing 5 changed files with 348 additions and 144 deletions.
Empty file modified start-govtool.sh
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions ui/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ["@babel/preset-react", "@babel/preset-typescript"],
};
23 changes: 15 additions & 8 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
},
"homepage": "https://github.com/IntersectMBO/govtool-outcomes-pillar",
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-json": "^6.1.0",
Expand All @@ -45,27 +48,31 @@
"postcss": "^8.4.49",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^7.0.1",
"react-router-dom": "^6.23.1",
"rollup": "^4.28.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"sass": "^1.81.1",
"semantic-release": "^24.2.1",
"tailwindcss": "^3.4.17",
"tslib": "^2.8.1",
"typescript": "^5.7.2"
},
"dependencies": {
"@fontsource/poppins": "^5.1.1",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.1.0"
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@fontsource/poppins": "^5.0.14",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@mui/material": "^5.15.18",
"sass": "^1.77.2"
},
"peerDependencies": {
"@emotion/react": "11.11.4",
"@emotion/styled": "11.11.5",
"@mui/material": "5.15.18",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mui/material": "^5.15.18",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^7.0.1"
"react-router-dom": "^6.23.1",
"sass": "^1.77.2"
}
}
24 changes: 20 additions & 4 deletions ui/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import json from "@rollup/plugin-json";
import postcss from "rollup-plugin-postcss";
import peerDepsExternal from "rollup-plugin-peer-deps-external";
import dts from "rollup-plugin-dts";
import babel from "@rollup/plugin-babel";

const packageJson = require("./package.json");

Expand All @@ -26,21 +27,36 @@ export default [
],
plugins: [
peerDepsExternal(),
resolve(),
commonjs(),
resolve({
extensions: ['.js', '.jsx', '.ts', '.tsx']
}),
babel({
babelHelpers: 'bundled',
presets: ['@babel/preset-react', '@babel/preset-typescript'],
extensions: ['.js', '.jsx', '.ts', '.tsx']
}),
commonjs({
include: 'node_modules/**',
transformMixedEsModules: true,
strictRequires: true
}),
typescript({
tsconfig: "./tsconfig.json",
}),
terser(),
postcss({ extract: true, inject: true, use: "sass" }),
json(),
],
external: ["react", "react-dom"],
external: [
"react",
"react-dom",
/^@intersect\.mbo\/intersectmbo\.org-icons-set/
],
},
{
input: "src/index.ts",
output: [{ file: packageJson.types }],
plugins: [dts.default()],
external: [/\.scss$/],
},
];
];
Loading

0 comments on commit 4a4a1a1

Please sign in to comment.