Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3796314
D3600.id9305.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D3600.id9305.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D3600: Adopt local tunnel
Attached
Detach File
Event Timeline
Log In to Comment