gulp

Gulp, Reactify, and Babelify not transforming together

不羁岁月 提交于 2019-12-06 01:37:31
问题 This is my gulpfile code: gulp.task('react', function () { browserify('app/src/main.jsx') .transform(reactify) .transform(babelify) .bundle() .pipe(source('app.js')) .pipe(streamify(uglify())) .pipe(gulp.dest('dist/js/')); }); Only the first transform statement runs, and therefor throws an error due to the lack of additional transform (I'm writing in ES6 and JSX w/ react). I'm at a complete loss and would really appreciate help. 回答1: Reactify should no longer be used. You don't say what

Set working directory in gulpfile.js?

时光怂恿深爱的人放手 提交于 2019-12-06 01:32:50
问题 Is there a way to set the working directory for Gulp within a gulpfile, so that I can run a gulp command from a subdirectory without running into any issues? I ran a search for this and didn't find what I was looking for. To clarify, I'm aware of adding a prefix to the files I'm using. However, instead of this - var gulp = require('gulp'); var jshint = require('gulp-jshint'); ... var paths = { js: [__dirname + 'app/*/*.js', __dirname + '!app/lib/**'], css: __dirname + 'app/*/*.styl', img: _

Including/excluding globs for gulp.src

六眼飞鱼酱① 提交于 2019-12-06 01:16:08
I'm trying to setup a glob array for my javascript concat build task in gulp . The directory structure looks as follows: ├── about │ └── about.js ├── assets ├── contact ├── core │ ├── navbar │ │ ├── navbar.js │ │ └── navbar.test.js │ ├── routing.js │ ├── routing.test.js │ ├── utils.js │ └── utils.test.js ├── generated │ ├── footer.js │ ├── header.js │ └── templates.js ├── home ├── app.js └── config.js The order of the files is important: generated/header.js app.js any of the *.js files, except those here below generated/templates.js generated/footer.js I've wildly tried all kinds of wildcards

Gulp sourcemaps with TypeScript and Babel

廉价感情. 提交于 2019-12-05 22:49:47
问题 I am currently writing a side project where I can learn more about TypeScript and ES6 (using babel). I wanted to use ES6 with my TypeScript, so I settled on the following workflow. Typescript (ES6) -> Babel (ES6) -> ES5 Now I am using Gulp to automate all of this, and I am having a hard time getting the sourcemaps to generate properly. I should mention that this style was suggested to me by a user on /r/typescript so I am not even sure if it is possible. Anyways here is my current gulp task

Using ES6 modules with traceur in single build file

我与影子孤独终老i 提交于 2019-12-05 22:42:27
I just have a simple question cant get in any place, heve been googling for it all morning. There is no much info about traceur and when there is is not so clear, at least to me. How should be implemented the ES6 modules when im transpiling with traceur a single output file and using it in the browser with traceur-runtime? import and export keeps getting Unexpected token. I am using gulp-traceur and tried already all the modules options //'commonjs' //'amd', 'commonjs', 'instantiate', 'inline', 'register'. One doubt I have is that I keep finding answers about commonjs, but my idea of using ES6

How do I properly separate my app.js and vendor.js bundles using Browserify?

家住魔仙堡 提交于 2019-12-05 21:42:59
My goals are to include the following in my HTML file and have them all work properly: index.html: <script type="text/javascript" src="./vendor.js"></script> <script type="text/javascript" src="./app.js"></script> $(document).ready(function() { // jQuery should be available as `window.$` $(".myclass").doSomethingWithJquery(); } <div class="row"> <h1 class="col-md-3 col-md-offset-3"> I should be able to use bootstrap, including bootstrap's javascript libraries, in my templates </h1> </div> <!-- I should be able to use app.js, with its various require('module') statements and attach rendered

Gulp error: Path must be a string

蓝咒 提交于 2019-12-05 21:36:58
I've got a problem with gulp.js. Steps to reproduce: $ composer global require "laravel/installer=~1.1" $ laravel new myproject $ cd myproject $ php artisan serve $ npm install $ npm rm bootstrap-sass —save $ npm install foundation-sites —save $ npm install motion-ui —save then I copy _settings.scss from node_modules/foundation-sites/scss/settings to resources/assets/sass in app.scss then i put every Foundation import and finally I write Elixir task as reported here: http://zecipriano.com/en/2015/12/laravel-elixir-and-zurb-foundation-revisited/ But when I launch gulp from terminal: path.js:7

gulp typescript throws error TS2300: Duplicate identifier 'moment'

喜你入骨 提交于 2019-12-05 21:32:43
问题 I have an Angular application generated using Yeoman gulp typescript generator. Suddenly without any apparent reason (change in project) during build typescript started throwing errors: .tmp/typings/moment/moment-node.d.ts(6,16): error TS2300: Duplicate identifier 'moment'. [22:08:34] [TypeScript] TypeScript error: .tmp/typings/moment/moment-node.d.ts(6,16): error TS2300: Duplicate identifier 'moment'. .tmp/typings/moment/moment.d.ts(8,13): error TS2300: Duplicate identifier 'moment'. See

gulp-ruby-sass unable to import files

穿精又带淫゛_ 提交于 2019-12-05 21:28:57
I am trying to create a gulp-ruby-sass task however i am seeing the following error: [17:32:34] gulp-ruby-sass: error ./styles.scss (Line 1: File to import not found or unreadable: header.scss. Load path: C:/Users/nassi/AppData/Local/Temp/gulp-ruby-sass) My project structure: app assets css _header.scss _home.scss _navigation.scss _buttons.scss _dialogs.scss styles.scss Within styles.scss i have: @import "header.scss"; @import "home.scss"; @import "navigation.scss"; @import "buttons.scss"; @import "dialogs.scss"; My gulp tasks: var paths = { sass: ['assets/css/styles.scss'] }; // SASS task

How to automate the build from the following configuration using gulp

北战南征 提交于 2019-12-05 21:23:26
Backdrop I have a loopback and Angular app, Loopback gives use the server models and api's and using its sdk we are able to get client services. Now i am planning to automate the following build process using gulp. If any changes in the model is made then the sdk command is run and also the server is restarted/ and secondly when any changes to the angular files the sdk files are run and files are fetched from angular dist folder and server is restarted and best possible we can use live reload of browser. Here is what i have tried and this never seems to work have been working on this for days.