mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
commit
81abc75b1f
9650
package-lock.json
generated
9650
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@ -6,11 +6,17 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node ./build.js ./build",
|
"build": "node ./build.js ./build",
|
||||||
"serve": "node ./server.js ./build 3000",
|
"serve": "node ./server.js ./build 3000",
|
||||||
"test": "npm run build && npm run serve"
|
"test": "npm run build && npm run serve",
|
||||||
|
"hot": "concurrently \"nodemon --exec npm test\" \"await tcp localhost:3000 && open-cli http://localhost:3000\""
|
||||||
},
|
},
|
||||||
"author": "Lospec",
|
"author": "Lospec",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
"nodemonConfig": {
|
||||||
|
"ext": "js,hbs,scss",
|
||||||
|
"ignore": "build/"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"concurrently": "^6.0.2",
|
||||||
"express": "^4.16.4",
|
"express": "^4.16.4",
|
||||||
"fs-extra": "^7.0.1",
|
"fs-extra": "^7.0.1",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
@ -20,7 +26,12 @@
|
|||||||
"gulp-sass": "^4.0.2",
|
"gulp-sass": "^4.0.2",
|
||||||
"handlebars-helper-svg": "git+https://bitbucket.org/skeddles/npm-handlebars-helper-svg-lospec-open-source.git",
|
"handlebars-helper-svg": "git+https://bitbucket.org/skeddles/npm-handlebars-helper-svg-lospec-open-source.git",
|
||||||
"nodemon": "^2.0.7",
|
"nodemon": "^2.0.7",
|
||||||
"open": "^6.0.0",
|
"open": "^8.0.6",
|
||||||
|
"open-cli": "^6.0.1",
|
||||||
"sass": "^1.17.3"
|
"sass": "^1.17.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"reload": "^3.1.1",
|
||||||
|
"wait-cli": "^1.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
20
server.js
20
server.js
@ -1,6 +1,6 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
|
const reload = require('reload');
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
const BUILDDIR = process.argv[2] || './build';
|
const BUILDDIR = process.argv[2] || './build';
|
||||||
@ -13,6 +13,11 @@ app.get('/', (req, res) => {
|
|||||||
console.log('error sending file', err);
|
console.log('error sending file', err);
|
||||||
} else {
|
} else {
|
||||||
console.log("Server: Successfully served index.html");
|
console.log("Server: Successfully served index.html");
|
||||||
|
setTimeout(()=>{
|
||||||
|
console.log('closing server');
|
||||||
|
res.app.server.close();
|
||||||
|
process.exit();
|
||||||
|
},1000*10);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -20,14 +25,9 @@ app.get('/', (req, res) => {
|
|||||||
//ROUTE - other files
|
//ROUTE - other files
|
||||||
app.use(express.static(path.join(__dirname, BUILDDIR)));
|
app.use(express.static(path.join(__dirname, BUILDDIR)));
|
||||||
|
|
||||||
|
reload(app).then(() => {
|
||||||
//start server
|
//start server
|
||||||
var server = app.listen(PORT, () => {
|
app.server = app.listen(PORT, function () {
|
||||||
console.log(`\nTemp server started at http://localhost:${PORT}!`);
|
console.log('Web server listening on port ' + PORT)
|
||||||
//console.log('press ctrl+c to stop ');
|
})
|
||||||
|
|
||||||
var opn = require('open');
|
|
||||||
|
|
||||||
// opens the url in the default browser
|
|
||||||
opn(`http://localhost:${PORT}`);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -621,5 +621,6 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script src="/pixel-editor/pixel-editor.js"></script>
|
<script src="/pixel-editor/pixel-editor.js"></script>
|
||||||
|
<script src="/reload/reload.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user