cluedin-widget
Version: 
This project contains all the pages needed for browsing entities and searching them. The aim is to replace the CluedIn.Webapp project with this one when all the pages ( including the Admin page ) will be ported to REACT.
65 lines (55 loc) • 1.93 kB
JavaScript
var gulp = require('gulp');  // Base gulp package
var rename = require('gulp-rename'); // Rename sources
var sass = require('gulp-sass');
var webpack = require('webpack-stream');
var webpackConfig = require('./webpack.config');
console.log(webpackConfig);
gulp.task('sass', function () {
  gulp.src('./test/static/index.scss')
    .pipe(sass().on('error', sass.logError))
    .pipe(gulp.dest('./test/static/'));
});
gulp.task('sassProd', function () {
  gulp.src('./build/index.scss')
    .pipe(sass().on('error', sass.logError))
    .pipe(rename('cluedin_widget.css'))
    .pipe(gulp.dest('./dist/'));
});
gulp.task('sass:watch', function () {
  gulp.watch('./app/sass/app.scss', ['sass']);
});
gulp.task('buildIndex', ['sass', 'sassProd'], function () {
  gulp.src('./build/index.js')
    .pipe(webpack(webpackConfig))
    .pipe(rename('cluedin_widget.js'))
    .pipe(gulp.dest('./dist/'));
});
gulp.task('buildChrome', ['sass', 'sassProd'], function () {
  gulp.src('./build/chrome.js')
    .pipe(webpack(webpackConfig))
    .pipe(rename('cluedin_chrome.js'))
    .pipe(gulp.dest('./dist/'));
});
gulp.task('buildAuth', ['sass', 'sassProd'], function () {
  gulp.src('./build/auth.js')
    .pipe(webpack(webpackConfig))
    .pipe(rename('cluedin_auth.js'))
    .pipe(gulp.dest('./dist/'));
});
gulp.task('buildSalesforce', ['sass', 'sassProd'], function () {
  gulp.src('./build/salesforce.js')
    .pipe(webpack(webpackConfig))
    .pipe(rename('cluedin_salesforce.js'))
    .pipe(gulp.dest('./dist/'));
});
gulp.task('default', ['buildIndex', 'buildChrome', 'buildSalesforce', 'buildAuth']);
/*
 gulp.task( 'demo', [ 'sass', 'sassProd' ], function() {
 browserify( "./demo/demo.jsx" )
 .transform( "babelify", {
 presets: [ "es2015", "react", "stage-1" ],
 plugins: [ "transform-decorators-legacy", "transform-object-rest-spread" ]
 } )
 .bundle()
 .pipe( fs.createWriteStream( "./dist/cluedin_demo.js" ) );
 } );*/