Add to git
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
console.log("Installing NPM packages");
|
||||
|
||||
exec('npm install',
|
||||
function (error, stdout, stderr) {
|
||||
if (error !== null) {
|
||||
console.error("ERROR installing NPM packages", error);
|
||||
}
|
||||
else {
|
||||
console.error("Successfully installed NPM packages", stdout, stderr);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
var open = require("open");
|
||||
|
||||
open("http://localhost:8080");
|
||||
@@ -0,0 +1,20 @@
|
||||
var npm = require("npm");
|
||||
var open = require("open");
|
||||
|
||||
npm.load(function(err) {
|
||||
npm.commands.run(['webpack-production'], function(er, data) {
|
||||
// log errors or data
|
||||
if (er){
|
||||
console.error(er);
|
||||
}
|
||||
|
||||
if (data) {
|
||||
console.log("Publish done!");
|
||||
}
|
||||
});
|
||||
|
||||
npm.on('log', function(message) {
|
||||
// log installation progress
|
||||
console.log(message);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
var npm = require("npm");
|
||||
var open = require("open");
|
||||
|
||||
npm.load(function(err) {
|
||||
npm.commands.run(['webpack-dev-server'], function(er, data) {
|
||||
// log errors or data
|
||||
if (er){
|
||||
console.error(er);
|
||||
}
|
||||
});
|
||||
|
||||
open("http://localhost:8080");
|
||||
npm.on('log', function(message) {
|
||||
// log installation progress
|
||||
console.log(message);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user