Youen Toupin
3 years ago
8 changed files with 111 additions and 0 deletions
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<projectDescription> |
||||
<name>WebApp</name> |
||||
<comment></comment> |
||||
<projects> |
||||
</projects> |
||||
<buildSpec> |
||||
</buildSpec> |
||||
<natures> |
||||
</natures> |
||||
</projectDescription> |
@ -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" |
||||
} |
||||
} |
@ -0,0 +1,4 @@
|
||||
import m from 'mithril'; |
||||
import MainPage from './main-page'; |
||||
|
||||
m.mount(document.body, MainPage); |
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE HTML> |
||||
<head> |
||||
<meta charset="UTF-8"/> |
||||
<title>Ordinateur de bord</title> |
||||
</head> |
||||
<body> |
||||
<p>Chargement...</p> |
||||
</body> |
@ -0,0 +1,7 @@
|
||||
import m from 'mithril'; |
||||
|
||||
export default class MainPage { |
||||
view() { |
||||
return <p>Hello, world!</p> |
||||
} |
||||
} |
@ -0,0 +1,12 @@
|
||||
{ |
||||
"compilerOptions": { |
||||
"noImplicitAny": true, |
||||
"module": "CommonJS", |
||||
"esModuleInterop": true, |
||||
"target": "es5", |
||||
"jsx": "react", |
||||
"jsxFactory": "m", |
||||
"allowJs": true, |
||||
"moduleResolution": "node" |
||||
} |
||||
} |
@ -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