gulp

What's the most efficient way to read, rebuild, and replace a block of content in a file using Gulp?

主宰稳场 提交于 2020-01-04 00:42:12
问题 I'm creating a system that can read through any file (php, jsp, html, etc), locate block tags, and do a replacement based on the information in the block tag. Code I would write into my file: <!-- build:<name> --> { "testObject": { "name": "jonathan", "number": 3, "male": true } } <!-- endBuild --> Desired replacement: <h1>Jonathan</h1> <p>is a male and is positioned at #3.</p> As you may notice, I've used components of gulp-html-replace. I've researched gulp-data and know how to use gulp.src

Start a shell process in Gulp with callback when process started

我是研究僧i 提交于 2020-01-03 19:02:52
问题 I'm trying to run some tasks in Gulp, sequentially. One of those tasks is a shell script that performs a simple $ node app.js . How can I fire the callback so I can tell Gulp that the server has started? tl;dr So here's the bigger picture of what I'm trying to accomplish: I'm using gulp run-sequence to fire up a number of tasks sequentially, which specifies a couple ways you should be writing your tasks in order for them to be run in sequence. Each gulp.task() must either: return the stream

vueify (in gulp task) with babel transform of vue files

﹥>﹥吖頭↗ 提交于 2020-01-03 17:19:12
问题 fixed. The solution is to: pass through .transform(babelify) as well ensure all your .vue -file script elements look like <script type="text/javascript"> -- that type attribute must come before custom attributes, lang attribute.. might ahve to be the first, even only attribute on the tag. I think my problem is that I have es6 in my vues. I am getting: [09:33:36] Starting 'public'... events.js:160 throw er; // Unhandled 'error' event ^ SyntaxError: 'import' and 'export' may appear only with

Sprity (gulp spriting image/scss generator) various errors when run task

笑着哭i 提交于 2020-01-03 14:00:20
问题 Not being massively experienced with gulp, this may well be a simple mistake on my part, but I've not been able to find a solution that works anywhere online... hoping stack overflow can save me! I'm trying to create a spritesheet and associated SASS (.scss) stylesheet using the node plugin sprity. https://www.npmjs.com/package/sprity I've installed sprity and sprity-sass (as well as gulp-sass and others I was already using). I got a number of errors during installation - don't know if these

Sprity (gulp spriting image/scss generator) various errors when run task

我只是一个虾纸丫 提交于 2020-01-03 14:00:07
问题 Not being massively experienced with gulp, this may well be a simple mistake on my part, but I've not been able to find a solution that works anywhere online... hoping stack overflow can save me! I'm trying to create a spritesheet and associated SASS (.scss) stylesheet using the node plugin sprity. https://www.npmjs.com/package/sprity I've installed sprity and sprity-sass (as well as gulp-sass and others I was already using). I got a number of errors during installation - don't know if these

A lot of warnings with webpack uglify

*爱你&永不变心* 提交于 2020-01-03 09:07:52
问题 When I'm running webpack uglify plugin and I'm getting a lot of warnings from the stylus loader / css-loader. How can I resolve them? The webpack bundles it successfully. Condition always true [./~/style-loader!./~/css-loader!./~/stylus-loader!./app/<filename>.styl:10,0] 回答1: That's normal -- by default Uglify tells you about the dead code that it strips out. If you don't want those "warnings" output, you can configure the plugin not to: new Webpack.optimize.UglifyJsPlugin({ compress: {

how do I increase stack trace of gulp task?

半城伤御伤魂 提交于 2020-01-03 09:06:14
问题 $ gulp patch [17:13:27] Requiring external module coffee-script/register [17:13:28] Using gulpfile ~/source/sem-campaign.js/gulpfile.coffee [17:13:28] Starting 'bump'... [17:13:28] Starting 'add'... [17:13:28] Bumped version to: 1.0.2 [17:13:28] Bumped version to: 1.0.2 [17:13:28] Finished 'bump' after 31 ms [17:13:28] [17:13:28] Finished 'add' after 30 ms [17:13:28] Starting 'commit'... [?] enter a commit msg, eg initial commit: initial commit [17:13:32] Finished 'commit' after 3.26 s [17:13

How to build angular2 app for production

柔情痞子 提交于 2020-01-03 05:38:08
问题 I've complete the angular2 tour of heroes . And I wonder what if I'd like to build this project for production. I want to add only 2 files to index.html : appScripts.js and vendorScripts.js . I've compiled my ts files with option outFile so I have my appScripts.js but it doesn't work. Here is some code in my gulpfile: gulp.task('compile', ['clean'], function() { var tsProject = typescript.createProject('tsconfig.json', { outFile: 'app.js' }); var tsResult = gulp.src(['app/**/*.ts']) .pipe

Jhipster application development with Docker and gulp

若如初见. 提交于 2020-01-03 04:34:12
问题 I am working on a Jhipster application, and am running this application using docker. This is working, however its very cumbersome. I would like to be able to make UI changes (text, css, html etc) and benefit from gulp and browsersync, that is for example, make a change to an html file, save the file, and have the browser automatically refresh and show the change. However, the only way I can get changes visible in the browser is to: 1 stop the docker container 2 stop gulp 3 rebuild docker

gulp: How do i pipe a css file in between scss files? gulp.src(['sassfile1.scss', 'cssfile.css' ,'sassfile2.scss'])

做~自己de王妃 提交于 2020-01-03 02:29:33
问题 this is my current code part in gulpfile.js: // Sass gulp.task('sass', function () { gulp.src(['./node_modules/bootstrap/scss/bootstrap.scss', './node_modules/startbootstrap-full-slider/css/full-slider.css' ,'./sass/**/*.scss']) .pipe(sourcemaps.init()) .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 7', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4')) .pipe(sourcemaps.write('./')) .pipe(concat('style.css')) .pipe