Skip to content

Commit

Permalink
Merge pull request akiran#1387 from maddhruv/webpack-dev
Browse files Browse the repository at this point in the history
open server url on webpack dev server start
  • Loading branch information
akiran authored Oct 13, 2018
2 parents b358e0a + d8cb3ce commit 207cd39
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
9 changes: 8 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ var webpack = require("webpack");
var WebpackDevServer = require("webpack-dev-server");
var runSequence = require("run-sequence");
var assign = require("object-assign");
var opn = require("opn");

const DEV_PORT = 8080;

gulp.task("default", ["watch", "server"]);

Expand Down Expand Up @@ -62,9 +65,13 @@ gulp.task("server", ["watch", "copy", "sass"], function(callback) {
contentBase: "./build",
hot: true,
debug: true
}).listen(8080, "0.0.0.0", function(err, result) {
}).listen(DEV_PORT, "0.0.0.0", function(err, result) {
if (err) {
console.log(err);
} else {
const server_url = `http://localhost:${DEV_PORT}`;
console.log(`> Dev Server started at ${server_url}`);
opn(server_url);
}
});
callback();
Expand Down
23 changes: 17 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
"version": "0.23.1",
"description": " React port of slick carousel",
"main": "./lib",
"files": ["dist", "lib"],
"files": [
"dist",
"lib"
],
"scripts": {
"start": "gulp server",
"build": "gulp clean && gulp sass && gulp copy && webpack",
"prepublish": "babel ./src --out-dir ./lib && gulp dist",
"test": "eslint src && jest",
"test:watch": "jest --watch",
"lint": "eslint src",
"gen":
"node examples/scripts/generateExampleConfigs.js && node examples/scripts/generateExamples.js && xdg-open docs/jquery.html",
"gen": "node examples/scripts/generateExampleConfigs.js && node examples/scripts/generateExamples.js && xdg-open docs/jquery.html",
"precommit": "lint-staged"
},
"author": "Kiran Abburi",
Expand Down Expand Up @@ -63,6 +65,7 @@
"json-loader": "^0.5.4",
"lint-staged": "^7.0.3",
"node-sass": "^4.5.2",
"opn": "^5.4.0",
"postcss-loader": "^1.3.3",
"raf": "^3.4.0",
"react": "^16.0.0",
Expand All @@ -83,27 +86,35 @@
"enquire.js": "^2.1.6",
"json2mq": "^0.2.0",
"lodash.debounce": "^4.0.8",
"prettier": "^1.14.3",
"resize-observer-polyfill": "^1.5.0"
},
"peerDependencies": {
"react": "^0.14.0 || ^15.0.1 || ^16.0.0",
"react-dom": "^0.14.0 || ^15.0.1 || ^16.0.0"
},
"jest": {
"setupFiles": ["./test-setup.js"],
"setupFiles": [
"./test-setup.js"
],
"testPathIgnorePatterns": [
"/__tests__/scripts.js",
"/__tests__/testUtils.js"
]
},
"lint-staged": {
"*.{js,json,md}": ["prettier --write", "git add"]
"*.{js,json,md}": [
"prettier --write",
"git add"
]
},
"npmName": "react-slick",
"npmFileMap": [
{
"basePath": "/dist/",
"files": ["*.js"]
"files": [
"*.js"
]
}
],
"bugs": {
Expand Down

0 comments on commit 207cd39

Please sign in to comment.