Added WebApp project
This commit is contained in:
parent
15b7838219
commit
8bdd34412f
4
WebApp/.gitignore
vendored
Normal file
4
WebApp/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
package-lock.json
|
||||
www
|
||||
|
11
WebApp/.project
Normal file
11
WebApp/.project
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>WebApp</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
</natures>
|
||||
</projectDescription>
|
23
WebApp/package.json
Normal file
23
WebApp/package.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "vehicle-monitor-webapp",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"dev": "webpack --mode development --watch",
|
||||
"build": "webpack --mode production"
|
||||
},
|
||||
"author": "Youen Toupin",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"mithril": "^2.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mithril": "^2.0.9",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"ts-loader": "^9.2.8",
|
||||
"typescript": "^4.6.2",
|
||||
"webpack": "^5.70.0",
|
||||
"webpack-cli": "^4.9.2"
|
||||
}
|
||||
}
|
4
WebApp/src/app.ts
Normal file
4
WebApp/src/app.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import m from 'mithril';
|
||||
import MainPage from './main-page';
|
||||
|
||||
m.mount(document.body, MainPage);
|
8
WebApp/src/index.html
Normal file
8
WebApp/src/index.html
Normal file
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE HTML>
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>Ordinateur de bord</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Chargement...</p>
|
||||
</body>
|
7
WebApp/src/main-page.tsx
Normal file
7
WebApp/src/main-page.tsx
Normal file
@ -0,0 +1,7 @@
|
||||
import m from 'mithril';
|
||||
|
||||
export default class MainPage {
|
||||
view() {
|
||||
return <p>Hello, world!</p>
|
||||
}
|
||||
}
|
12
WebApp/tsconfig.json
Normal file
12
WebApp/tsconfig.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noImplicitAny": true,
|
||||
"module": "CommonJS",
|
||||
"esModuleInterop": true,
|
||||
"target": "es5",
|
||||
"jsx": "react",
|
||||
"jsxFactory": "m",
|
||||
"allowJs": true,
|
||||
"moduleResolution": "node"
|
||||
}
|
||||
}
|
42
WebApp/webpack.config.js
Normal file
42
WebApp/webpack.config.js
Normal file
@ -0,0 +1,42 @@
|
||||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
entry: './src/app.ts',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, './www/'),
|
||||
clean: true,
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
template: './src/index.html',
|
||||
hash: true
|
||||
})
|
||||
],
|
||||
optimization: {
|
||||
moduleIds: 'deterministic',
|
||||
runtimeChunk: 'single',
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
vendor: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name: 'vendors',
|
||||
chunks: 'all',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
Loading…
Reference in New Issue
Block a user