Module: check_mk
Branch: master
Commit: 022dcd95c882cb969831b459b120c4fa2e815abf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=022dcd95c882cb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 19 11:16:39 2018 +0100
Introduce npm and webpack environment for improving JS frontend development
* Next steps:
* Modularize our own JS code and integrate it with the GUI
* Cleanup the previous JS minify logic
Change-Id: I9a9abbee4178a128141852e664f4c5c51754d84f
---
.gitignore | 1 +
package.json | 23 +++++++++++++++++++++++
web/Makefile | 5 +++++
webpack.config.js | 17 +++++++++++++++++
4 files changed, 46 insertions(+)
diff --git a/.gitignore b/.gitignore
index c3ec4772..8d4517c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,3 +49,4 @@ tests/web/data/*
.venv
*.gcov
htmlcov/
+node_modules/
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..79ef440
--- /dev/null
+++ b/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "check_mk",
+ "version": "1.0.0",
+ "description": "Check_MK - Your complete IT monitoring solution",
+ "main": "web/htdocs/js/index.js",
+ "directories": {
+ "doc": "doc",
+ "test": "tests"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit
1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "http://git.mathias-kettner.de/check_mk.git"
+ },
+ "author": "",
+ "license": "GPL-2.0",
+ "devDependencies": {
+ "webpack": "^4.27.1",
+ "webpack-cli": "^3.1.2"
+ }
+}
diff --git a/web/Makefile b/web/Makefile
new file mode 100644
index 0000000..f51990b
--- /dev/null
+++ b/web/Makefile
@@ -0,0 +1,5 @@
+setup:
+ sudo apt-get install \
+ npm
+ npm install
+
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 0000000..2998d12
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,17 @@
+var path = require('path');
+
+module.exports = {
+ mode: 'development',
+ entry: './web/htdocs/js/index.js',
+ output: {
+ path: path.resolve(__dirname, 'web/htdocs/js'),
+ filename: 'main.js',
+ publicPath: 'js'
+ },
+ resolve: {
+ modules: [
+ "node_modules",
+ path.resolve(__dirname, "web/htdocs/js")
+ ]
+ }
+};