Skip to content

Commit

Permalink
Added static file copy script to build process
Browse files Browse the repository at this point in the history
  • Loading branch information
MSDev201 committed Aug 24, 2020
1 parent a04be01 commit 2e4e25f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
18 changes: 18 additions & 0 deletions copy_static_files.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
let fs = require('fs');
let mkdirp = require('mkdirp');
let getDirName = require('path').dirname;

let copy = [
{ from: './src/css/worldmap.dark.css', to: './dist/css/worldmap.dark.css' },
{ from: './src/css/worldmap.light.css', to: './dist/css/worldmap.light.css' },
];

copy.forEach(path => {
let dir = getDirName(path.to);
if (!fs.existsSync(dir)) {
mkdirp(dir, function (err) {
if (err) return cb(err);
});
}
fs.createReadStream(path.from).pipe(fs.createWriteStream(path.to));
});
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "worldmap-panel",
"version": "1.0.1",
"description": "Worldmap Panel Plugin for Grafana",
"main": "src/module.js",
"main": "src/module.ts",
"scripts": {
"build": "grafana-toolkit plugin:build",
"test": "grafana-toolkit plugin:test",
"dev": "grafana-toolkit plugin:dev",
"watch": "grafana-toolkit plugin:dev --watch"
"build": "node ./copy_static_files.js && grafana-toolkit plugin:build",
"test": "node ./copy_static_files.js && grafana-toolkit plugin:test",
"dev": "node ./copy_static_files.js && grafana-toolkit plugin:dev",
"watch": "node ./copy_static_files.js && grafana-toolkit plugin:dev --watch"
},
"keywords": [
"worldmap",
Expand Down
5 changes: 0 additions & 5 deletions src/css/worldmap.dark.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.map-darken img.leaflet-tile {
/* -webkit-filter: brightness(1.6) grayscale(1) contrast(1);
filter: brightness(1.6) grayscale(1) contrast(1); */
}

.worldmap-popup .leaflet-popup-content-wrapper, .worldmap-popup .leaflet-popup-tip {
background-color: #333;
}

0 comments on commit 2e4e25f

Please sign in to comment.