Merge pull request #4 from SebastianSpeitel/master

Initial rollup config
This commit is contained in:
clerie 2020-04-08 13:28:56 +02:00 committed by GitHub
commit 9f49e7fbf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2226 additions and 2 deletions

6
.gitignore vendored
View File

@ -1,6 +1,12 @@
# Wetter custom
wetter/config/db.py
# JavaScript modules
node_modules
# Bundle output
wetter/static/bundle
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

2125
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

38
package.json Normal file
View File

@ -0,0 +1,38 @@
{
"name": "wetter",
"version": "0.0.1",
"description": "Wettervorhersagen gibt es mittlerweile wie Sand am Meer und es ist ein riesiges Geschäft darum gewachsen. Viel spannender jedoch ist, was die wirklichen Messergebnisse in der Vergangenheit so waren. Da diese Datenbestände nicht so einfach zu finden und für viele viel zu kompliziert zu verwenden sind, wurde diese Website erschaffen.",
"main": "index.js",
"scripts": {
"build": "./node_modules/.bin/rollup -c",
"build:production": "NODE_ENV=production npm run build --silent",
"postinstall": "npm run build --silent"
},
"repository": {
"type": "git",
"url": "git+https://github.com/clerie/wetter.git"
},
"author": "Clemens Riese",
"license": "AGPL-3.0-or-later",
"bugs": {
"url": "https://github.com/clerie/wetter/issues"
},
"homepage": "https://github.com/clerie/wetter#readme",
"devDependencies": {
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-node-resolve": "^7.1.1",
"rollup": "^1.32.1",
"rollup-plugin-copy": "^3.3.0",
"rollup-plugin-scss": "^2.1.0",
"rollup-plugin-terser": "^5.3.0"
},
"dependencies": {
"bootstrap": "^4.4.1",
"datatables": "^1.10.18",
"jquery": "^3.4.1",
"leaflet": "^1.6.0",
"moment": "^2.24.0",
"tempusdominus-bootstrap-4": "^5.1.2",
"tempusdominus-core": "^5.0.3"
}
}

37
rollup.config.js Normal file
View File

@ -0,0 +1,37 @@
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import { terser } from "rollup-plugin-terser";
import css from "rollup-plugin-scss";
import copy from "rollup-plugin-copy";
const production = process.env.NODE_ENV === "production";
const config = {
input: "wetter/static/wetter/js/wetter.js",
output: {
dir: "wetter/static/bundle",
format: "iife",
sourcemap: !production
},
plugins: [
copy({
targets: [
{
src: "node_modules/leaflet/dist/images/*",
dest: "wetter/static/bundle/images"
}
]
}),
css({
output: "wetter/static/bundle/bundle.css",
outFile: "wetter/static/bundle/bundle.css",
outputStyle: production ? "compressed" : "expanded",
sourceMap: !production
}),
resolve(),
commonjs(),
production && terser()
]
};
export default [config];

View File

@ -1,4 +1,22 @@
import "bootstrap";
import "bootstrap/dist/css/bootstrap.css";
import "datatables";
import "datatables/media/css/jquery.dataTables.css";
import $ from "jquery";
import "leaflet";
import "leaflet/dist/leaflet.css";
import "moment";
import "tempusdominus-bootstrap-4";
import "tempusdominus-bootstrap-4/build/css/tempusdominus-bootstrap-4.css";
import "../css/wetter.css";
// Entfernen des Clickoverlay wenn drauf geklickt wurde, #28
$('.clickoverlay').on('click', function () {
$(".clickoverlay").on("click", function () {
$(this).remove();
});