Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update SVGO and other devDependencies #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions buildscripts/svgtopng.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var svg2png = require('svg2png');
var ncp = require('ncp');
var path = require('path');
const fs = require("pn/fs"); // https://www.npmjs.com/package/pn
const svg2png = require("svg2png");

svg2png(path.resolve('src/images/toggle.svg'), path.resolve('src/images/toggle.png'), 1.0, function (err) {
ncp('src/images/toggle.png', 'dist/images/toggle.png');
});
fs.readFile("src/images/toggle.svg")
.then(svg2png)
.then(buffer => fs.writeFile("dist/images/toggle.png", buffer))
.catch(e => console.error(e));
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@
"bugs": {
"url": "https://github.com/Norkart/Leaflet-MiniMap/issues"
},
"dependencies": {
"leaflet": "^1.0.3"
},
"devDependencies": {
"clean-css": "3.0.7",
"clean-css-cli": "^4.2.1",
"happiness": "^1.0.7",
"leaflet": ">=1.0.3",
"ncp": "1.0.1",
"svg2png": "1.1.0",
"svgo": "0.5.0",
"uglify-js": "2.6.0"
"svg2png": "^4.1.1",
"svgo": "^1.2.0",
"uglify-js": "^3.4.10"
},
"scripts": {
"build:js": "uglifyjs --output dist/Control.MiniMap.min.js src/Control.MiniMap.js",
"build:css": "cleancss --skip-rebase --output dist/Control.MiniMap.min.css src/Control.MiniMap.css",
"build:img": "svgo src/images/toggle.svg dist/images/toggle.svg && node buildscripts/svgtopng.js",
"build:img": "svgo src/images/toggle.svg -o dist/images/toggle.svg && node buildscripts/svgtopng.js",
"build": "npm run build:css && npm run build:js && npm run build:img",
"test": "happiness src/**/*.js",
"preversion": "npm test && npm run build"
Expand Down