Skip to content

Instantly share code, notes, and snippets.

@allmarkedup
Created August 17, 2016 09:54
Show Gist options
  • Save allmarkedup/c6398774d2d6af669f4e339b5eadbcad to your computer and use it in GitHub Desktop.
Save allmarkedup/c6398774d2d6af669f4e339b5eadbcad to your computer and use it in GitHub Desktop.
Gulp using fractal.js file
'use strict';
/* Create a new Fractal instance and export it for use elsewhere if required */
const fractal = module.exports = require('@frctl/fractal').create();
/* Set the title of the project */
fractal.set('project.title', 'FooCorp Component Library');
/* Tell Fractal where the components will live */
fractal.components.set('path', __dirname + '/src/components');
/* Tell Fractal where the documentation pages will live */
fractal.docs.set('path', __dirname + '/src/docs');
/* Specify a directory of static assets */
fractal.web.set('static.path', __dirname + '/public');
/* Set the static HTML build destination */
fractal.web.set('builder.dest', __dirname + '/build');
'use strict';
const gulp = require('gulp');
const fractal = require('./fractal.js')
const logger = fractal.cli.console; // keep a reference to the fractal CLI console utility
/*
* Start the Fractal server
*/
gulp.task('fractal:start', function(){
const server = fractal.web.server({
sync: true
});
server.on('error', err => logger.error(err.message));
return server.start().then(() => {
logger.success(`Fractal server is now running at ${server.url}`);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment