Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3796293
D3600.id9302.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D3600.id9302.diff
View Options
diff --git a/components/gulpfile.js b/components/gulpfile.js
--- a/components/gulpfile.js
+++ b/components/gulpfile.js
@@ -1,23 +1,26 @@
'use strict';
-import plugins from 'gulp-load-plugins';
-import yargs from 'yargs';
+import autoprefixer from 'autoprefixer';
import browser from 'browser-sync';
+import fs from 'fs';
import gulp from 'gulp';
-import panini from 'panini';
+import gulpSass from 'gulp-sass';
+import gulpLoadPlugins from 'gulp-load-plugins';
+import imagemin from 'gulp-imagemin';
+import { gifsicle, mozjpeg, optipng, svgo } from 'gulp-imagemin';
import { rimraf } from 'rimraf';
-import yaml from 'js-yaml';
-import fs from 'fs';
-import webpackStream from 'webpack-stream';
-import webpack2 from 'webpack';
+import { localtunnel } from 'localtunnel';
import named from 'vinyl-named';
+import panini from 'panini';
+import sass from 'gulp-sass';
import uncss from 'uncss';
-import autoprefixer from 'autoprefixer';
-import imagemin from 'gulp-imagemin';
-import { gifsicle, mozjpeg, optipng, svgo } from 'gulp-imagemin';
-
+import webpack2 from 'webpack';
+import webpackStream from 'webpack-stream';
+import yaml from 'js-yaml';
+import yargs from 'yargs';
import * as dartSass from 'sass';
-import gulpSass from 'gulp-sass';
+
+const localtunnel = require('localtunnel');
const sass = gulpSass(dartSass);
// Load all Gulp plugins into one variable
@@ -33,7 +36,7 @@
const unsafe = require('js-yaml-js-types').all;
const schema = yaml.DEFAULT_SCHEMA.extend(unsafe);
let ymlFile = fs.readFileSync('config.yml', 'utf8');
- return yaml.load(ymlFile, { schema });
+ return yaml.load(ymlFile, {schema});
}
// Build the "dist" folder by running all of the below tasks
@@ -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:39 (21 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2270810
Default Alt Text
D3600.id9302.diff (3 KB)
Attached To
Mode
D3600: Adopt local tunnel
Attached
Detach File
Event Timeline
Log In to Comment