diff --git a/gulpfile.js b/gulpfile.js index 8d56e5bb9..f724e0548 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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"]); @@ -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(); diff --git a/package.json b/package.json index 0d736a964..c3dd3fd14 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,10 @@ "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", @@ -11,8 +14,7 @@ "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", @@ -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", @@ -83,6 +86,7 @@ "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": { @@ -90,20 +94,27 @@ "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": {