Browse Source

added css to rollup config

pull/4/head
Sebastian Speitel 2 years ago
parent
commit
fd8da4968c
  1. 3
      .gitignore
  2. 1441
      package-lock.json
  3. 1
      package.json
  4. 17
      rollup.config.js
  5. 11
      wetter/static/wetter/js/wetter.js

3
.gitignore vendored

@ -4,8 +4,9 @@ wetter/config/db.py @@ -4,8 +4,9 @@ wetter/config/db.py
# JavaScript modules
node_modules
# JavaScript output
# Bundle output
wetter/static/js
wetter/static/css
# Byte-compiled / optimized / DLL files
__pycache__/

1441
package-lock.json generated

File diff suppressed because it is too large Load Diff

1
package.json

@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-node-resolve": "^7.1.1",
"rollup": "^1.32.1",
"rollup-plugin-scss": "^2.1.0",
"rollup-plugin-terser": "^5.3.0"
},
"dependencies": {

17
rollup.config.js

@ -1,15 +1,28 @@ @@ -1,15 +1,28 @@
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";
const production = process.env.NODE_ENV === "production";
export default {
const config = {
input: "wetter/static/wetter/js/wetter.js",
output: {
dir: "wetter/static/js",
format: "iife",
sourcemap: !production
},
plugins: [resolve(), commonjs(), !production && terser()]
plugins: [
css({
output: "wetter/static/css/bundle.css",
outFile: "wetter/static/css/bundle.css",
outputStyle: production ? "compressed" : "expanded",
sourceMap: !production
}),
resolve(),
commonjs(),
production && terser()
]
};
export default [config];

11
wetter/static/wetter/js/wetter.js

@ -1,9 +1,20 @@ @@ -1,9 +1,20 @@
import "bootstrap";
import "../../../../node_modules/bootstrap/dist/css/bootstrap.css";
import "datatables";
import "../../../../node_modules/datatables/media/css/jquery.dataTables.css";
import $ from "jquery";
import "leaflet";
import "../../../../node_modules/leaflet/dist/leaflet.css";
import "moment";
import "tempusdominus-bootstrap-4";
import "../../../../node_modules/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 () {

Loading…
Cancel
Save