Skip to content

Commit

Permalink
Merge branch 'work/using-react-with-bootstrap4'
Browse files Browse the repository at this point in the history
  • Loading branch information
steinarb committed Oct 12, 2024
2 parents 5b85e08 + 5191ac5 commit 22adbd3
Show file tree
Hide file tree
Showing 8 changed files with 5,966 additions and 4,517 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>no.priv.bang.pom</groupId>
<artifactId>bang-authservice-client-pom</artifactId>
<version>2.0.5</version>
<version>2.0.6</version>
</parent>
<groupId>no.priv.bang.ukelonn</groupId>
<artifactId>ukelonn</artifactId>
Expand Down
3 changes: 3 additions & 0 deletions ukelonn.web.frontend/src/main/frontend/eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "react-app"
}
2 changes: 1 addition & 1 deletion ukelonn.web.frontend/src/main/frontend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { push } from 'redux-first-history';
import createUkelonnReducer from './reducers';
import { rootSaga } from './sagas';
const baseUrl = Array.from(document.scripts).map(s => s.src).filter(src => src.includes('bundle.js'))[0].replace('/bundle.js', '');
const baseUrl = Array.from(document.scripts).map(s => s.src).filter(src => src.includes('assets/'))[0].replace(/\/assets\/.*/, '');
const basename = new URL(baseUrl).pathname;
axios.defaults.baseURL = baseUrl;
const sagaMiddleware = createSagaMiddleware();
Expand Down
10,361 changes: 5,922 additions & 4,439 deletions ukelonn.web.frontend/src/main/frontend/package-lock.json

Large diffs are not rendered by default.

46 changes: 7 additions & 39 deletions ukelonn.web.frontend/src/main/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^2.2.3",
"axios": "^1.7.3",
"axios": "^1.7.7",
"delay": "^6.0.0",
"js-cookie": "^3.0.5",
"qs": "^6.12.0",
Expand All @@ -16,44 +16,12 @@
"redux-saga": "^1.3.0",
"validator": "^13.11.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"eslintConfig": {
"parser": "@babel/eslint-parser",
"env": {
"browser": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"rules": {
"react/prop-types": "off"
}
},
"babel": {
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
},
"devDependencies": {
"@babel/core": "^7.24.3",
"@babel/eslint-parser": "^7.24.1",
"@babel/preset-env": "^7.24.3",
"@babel/preset-react": "^7.24.1",
"babel-loader": "^9.1.3",
"css-loader": "^6.10.0",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-webpack-plugin": "^4.1.0",
"style-loader": "^3.3.4",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@nabla/vite-plugin-eslint": "^2.0.4",
"@vitejs/plugin-react": "^4.3.2",
"eslint-config-react-app": "^7.0.1",
"vite": "^5.4.8",
"vite-plugin-simple-html": "^0.1.2"
}
}
28 changes: 28 additions & 0 deletions ukelonn.web.frontend/src/main/frontend/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineConfig } from 'vite';
import eslintPlugin from "@nabla/vite-plugin-eslint";

export default defineConfig({
plugins: [eslintPlugin()],
build: {
minify: false,
sourcemap: true,
manifest: true,
rollupOptions: {
// overwrite default .html entry
input: 'index.js',
output: {
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`
}
},
// Relative to the root
outDir: '../../../target/classes',
},
// Treat .js files as jsx
esbuild: {
include: /\.js$/,
exclude: [],
loader: 'jsx',
},
});
36 changes: 0 additions & 36 deletions ukelonn.web.frontend/src/main/frontend/webpack.config.js

This file was deleted.

5 changes: 4 additions & 1 deletion ukelonn.web.frontend/src/main/resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
<!-- open-iconic icons for bootstrap -->
<link href="/ukelonn/open-iconic/font/css/open-iconic-bootstrap.min.css" rel="stylesheet">

<!-- Application's CSS -->
<link href="/ukelonn/assets/index.css" rel="stylesheet">

<title>Ukel&oslash;nn</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="root"></div>
<script src="/ukelonn/bundle.js" type="application/javascript" charset="utf-8"></script>
<script src="/ukelonn/assets/index.js" type="application/javascript" charset="utf-8"></script>
<noscript>This webpage requires javascript in the browser!</noscript>

<!-- Optional JavaScript -->
Expand Down

0 comments on commit 22adbd3

Please sign in to comment.