Page MenuHomeDevCentral

D3600.id9305.diff
No OneTemporary

D3600.id9305.diff

diff --git a/components/gulpfile.js b/components/gulpfile.js
--- a/components/gulpfile.js
+++ b/components/gulpfile.js
@@ -15,10 +15,13 @@
import autoprefixer from 'autoprefixer';
import imagemin from 'gulp-imagemin';
import { gifsicle, mozjpeg, optipng, svgo } from 'gulp-imagemin';
-
+import { localtunnel } from 'localtunnel';
+import sass from 'gulp-sass';
import * as dartSass from 'sass';
import gulpSass from 'gulp-sass';
+
const sass = gulpSass(dartSass);
+const localtunnel = require('localtunnel');
// Load all Gulp plugins into one variable
const $ = plugins();
@@ -151,13 +154,6 @@
.pipe(gulp.dest(config.paths.dist + '/assets/img'));
}
-// Start a server with BrowserSync to preview the site in
-function server(done) {
- browser.init({
- server: config.paths.dist, port: config.dev.port
- }, done);
-}
-
// Reload the browser with BrowserSync
function reload(done) {
browser.reload();
@@ -175,3 +171,22 @@
gulp.watch('src/assets/js/**/*.js').on('all', gulp.series(javascript, browser.reload));
gulp.watch('src/assets/img/**/*').on('all', gulp.series(images, browser.reload));
}
+
+// Start a server with BrowserSync to preview the site in
+function server(done) {
+ browser.init({
+ server: config.paths.dist,
+ port: config.dev.port,
+ tunnel: false,
+ }, done);
+
+ (async () => {
+ const tunnel = await localtunnel({ port: config.dev.port });
+
+ console.log('Tunnel URL:', tunnel.url);
+
+ tunnel.on('close', () => {
+ console.log('Localtunnel closed');
+ });
+ })();
+}
diff --git a/components/package-template.json b/components/package-template.json
--- a/components/package-template.json
+++ b/components/package-template.json
@@ -32,6 +32,7 @@
"gulp-uglify": "^3.0.2",
"js-yaml": "^4.1.0",
"js-yaml-js-types": "^1.0.1",
+ "localtunnel":"^2.0.2",
"panini": "^1.7.2",
"postcss": "^8.4.49",
"rimraf": "^6.0.1",
diff --git a/config.yml b/config.yml
--- a/config.yml
+++ b/config.yml
@@ -61,3 +61,4 @@
dev:
port: 8000
+ tunnel: true
diff --git a/package.json b/package.json
--- a/package.json
+++ b/package.json
@@ -32,6 +32,7 @@
"gulp-uglify": "^3.0.2",
"js-yaml": "^4.1.0",
"js-yaml-js-types": "^1.0.1",
+ "localtunnel":"^2.0.2",
"panini": "^1.7.2",
"postcss": "^8.4.49",
"rimraf": "^6.0.1",

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 05:43 (21 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2270817
Default Alt Text
D3600.id9305.diff (2 KB)

Event Timeline