diff --git a/WebApp/.gitignore b/WebApp/.gitignore
new file mode 100644
index 0000000..2482805
--- /dev/null
+++ b/WebApp/.gitignore
@@ -0,0 +1,4 @@
+node_modules
+package-lock.json
+www
+
diff --git a/WebApp/.project b/WebApp/.project
new file mode 100644
index 0000000..d780ade
--- /dev/null
+++ b/WebApp/.project
@@ -0,0 +1,11 @@
+
+
Chargement...
+ diff --git a/WebApp/src/main-page.tsx b/WebApp/src/main-page.tsx new file mode 100644 index 0000000..0dab169 --- /dev/null +++ b/WebApp/src/main-page.tsx @@ -0,0 +1,7 @@ +import m from 'mithril'; + +export default class MainPage { + view() { + returnHello, world!
+ } +} \ No newline at end of file diff --git a/WebApp/tsconfig.json b/WebApp/tsconfig.json new file mode 100644 index 0000000..3134765 --- /dev/null +++ b/WebApp/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "noImplicitAny": true, + "module": "CommonJS", + "esModuleInterop": true, + "target": "es5", + "jsx": "react", + "jsxFactory": "m", + "allowJs": true, + "moduleResolution": "node" + } +} diff --git a/WebApp/webpack.config.js b/WebApp/webpack.config.js new file mode 100644 index 0000000..996de34 --- /dev/null +++ b/WebApp/webpack.config.js @@ -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', + }, + }, + }, + }, +};