gulp

Gulp to watch when node app.listen() is invoked or to port (livereload, nodejs and gulp)

纵然是瞬间 提交于 2019-12-22 08:46:42
问题 I am trying to get gulp-livereload to work with my nodejs server. I am using gulp-nodemon to restart the server after changes to the files, this works. I am having trouble invoking livereload.reload() at the correct time. I am currently invoking livereload.reload() on the .on('start'... in my gulpfile.js (whenever my nodemon starts a script). This works but it takes a few seconds. The reason is when nodemon starts to run the nodejs script it invokes livereload.listen() before the script has

Installing CKEditor with npm

有些话、适合烂在心里 提交于 2019-12-22 08:16:14
问题 I am trying to install CKEditor in my project. I am using Laravel. I know I could download the files but I like making my life difficult and I decided that I want to install CKEditor as a npm dependency. As stated in their documentation here, I added the package to package.json, like this: "dependencies": { "jquery": "^1.11.1", "bootstrap-sass": "^3.0.0", "elixir-coffeeify": "^1.0.3", "laravel-elixir": "^4.0.0", "font-awesome": "^4.5.0", "ckeditor": "^4.5.7" } Now I guess I have to require it

aspnet core how to webpack build on deploy

空扰寡人 提交于 2019-12-22 07:42:10
问题 I have a aspnet core application with a vue.js part, which I build with webpack and everything works fine. Now I search a solution to create a productionbuild with it, to create a minified version of my vue bundle and to run vue in production mode (without console.logs), which I set in my webpack.config like: if (process.env.NODE_ENV === 'production') { module.exports.plugins = [ new webpack.DefinePlugin({ 'process.env': { NODE_ENV: '"production"' } }), new webpack.optimize.UglifyJsPlugin({

aspnet core how to webpack build on deploy

柔情痞子 提交于 2019-12-22 07:41:55
问题 I have a aspnet core application with a vue.js part, which I build with webpack and everything works fine. Now I search a solution to create a productionbuild with it, to create a minified version of my vue bundle and to run vue in production mode (without console.logs), which I set in my webpack.config like: if (process.env.NODE_ENV === 'production') { module.exports.plugins = [ new webpack.DefinePlugin({ 'process.env': { NODE_ENV: '"production"' } }), new webpack.optimize.UglifyJsPlugin({

How to use basic regular expressions within gulp.src?

时间秒杀一切 提交于 2019-12-22 07:11:11
问题 I'm trying to select two files with gulp.src : highcharts.js and highcharts.src.js . Of course I know I could add explicitly these two with an array expression, but for learning purposes I'm trying to write a single expression for them. I've read that one can use simple regular expression syntax but it's not clear how. I tried gulp.src("highcharts(\.src)?\.js") but it didn't match any files. 回答1: Gulp uses glob which doesn't support the regular expressions you're normally used to. It uses

Gulp Uglify Options not applying

主宰稳场 提交于 2019-12-22 06:59:08
问题 Hi I am making a theme for the company i work at and the JS segments will not build properly in uglify. I am trying to use uglify to simply concatenate my files, which works but they output minified and mangled with no comments and i cannot figure out why, below is my gulp task which runs correctly but doesnt output with the options provided gulp.task('js', function() { return gulp.src('./src/js/*.js') .pipe(uglify({ options: { mangle: false, beautify: true, comments: true } })) .pipe(rename(

Gulp glob to ignore file types and not copy empty folders

别说谁变了你拦得住时间么 提交于 2019-12-22 06:25:10
问题 I have created a glob for gulp which ignores javascript and coffeescript files within a set of directories. I'd like it to copy all other files into a directory which works fine. The only problem is that when there are only javascript or coffeescript files it copies an empty folder. Any ideas how this glob could be amended to not copy empty folders? gulp.task('copyfiles', function(){ gulp.src('apps/*/static_src/**/!(*.js|*.coffee)') .pipe(gulp.dest('dest')); }); Example source files: apps

Gulp glob to ignore file types and not copy empty folders

梦想与她 提交于 2019-12-22 06:23:05
问题 I have created a glob for gulp which ignores javascript and coffeescript files within a set of directories. I'd like it to copy all other files into a directory which works fine. The only problem is that when there are only javascript or coffeescript files it copies an empty folder. Any ideas how this glob could be amended to not copy empty folders? gulp.task('copyfiles', function(){ gulp.src('apps/*/static_src/**/!(*.js|*.coffee)') .pipe(gulp.dest('dest')); }); Example source files: apps

Rename file based on regex in Gulp

放肆的年华 提交于 2019-12-22 05:14:55
问题 Say I have a LESS CSS directory structure like this: less/ core/ _main.less header.less body.less footer.less contact/ _main.less form.less details.less I want to write a Gulp task that will look for the _main.less files in each subdirectory of the less/ dir, pass this to gulp-less and write the output to the css/ dir like this: css/ core.css contact.css Because _main.less includes the other files in it's directory, only the _main.less files will have to be parsed, but I want the output file

Why does Gulp fail to automatically re-process my JS upon changes?

徘徊边缘 提交于 2019-12-22 05:03:15
问题 In my gulpfile.js , JS changes automatically trigger both BrowserSync reload and my JS processing task. But for some reason, although the reload does work, my JS task fails to correctly process JS changes and create new JS file in dist/ folder. I have to restart Gulp for that. Why? Gulpfile.js: var gulp = require('gulp'); var sass = require('gulp-sass'); var browserSync = require('browser-sync').create(); var concat = require('gulp-concat'); var jshint = require('gulp-jshint'); var uglify =