Skip to content

Commit

Permalink
remove package
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane Osbourne committed Dec 27, 2023
1 parent 2e8dd31 commit b7bf92e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 204 deletions.
3 changes: 3 additions & 0 deletions packages/browser-sync/lib/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ module.exports = {
var localTunnel = require("./tunnel");
localTunnel(bs, function(err, tunnel) {
if (err) {
if (err.code === "MODULE_NOT_FOUND") {
return utils.fail(true, err, bs.cb);
}
return done(err);
} else {
return done(null, {
Expand Down
13 changes: 12 additions & 1 deletion packages/browser-sync/lib/tunnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ var utils = require("util");
* @param {Function} cb
*/
module.exports = function(bs, cb) {
var localtunnel;
try {
localtunnel = require("localtunnel");
} catch (e) {
if (e.code === "MODULE_NOT_FOUND") {
var error = new Error("Could not find package `localtunnel`. From Browsersync version 3.0 you'll need to install this manually.");
error.code = e.code;
return cb(error);
}
return cb(e);
}
var opts = {};
var options = bs.options;
var port = options.get("port");
Expand All @@ -22,7 +33,7 @@ module.exports = function(bs, cb) {
utils.inspect(opts)
);

require("localtunnel")(port, opts, function(err, tunnel) {
localtunnel(port, opts, function(err, tunnel) {
if (err) {
return cb(err);
}
Expand Down
209 changes: 14 additions & 195 deletions packages/browser-sync/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions packages/browser-sync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,6 @@
"typescript": "^4.6.2",
"vinyl": "1.2.0"
},
"optionalDependencies": {
"localtunnel": "^2.0.2"
},
"peerDependenciesMeta": {
"localtunnel": {
"optional": true
}
},
"keywords": [
"browser sync",
"css",
Expand Down

0 comments on commit b7bf92e

Please sign in to comment.