Skip to content

Commit

Permalink
Clean up and refactor code:
Browse files Browse the repository at this point in the history
- add webpack & gulp to allow faster building and separate files
- remove copy-pasted dependencies to npm
  • Loading branch information
evanmarshall committed Feb 26, 2018
1 parent e67ed7b commit 967e783
Show file tree
Hide file tree
Showing 12 changed files with 13,773 additions and 2,254 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
node_modules/
steemit-profile.js
.DS_Store
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@
This is a simple demo to let you create a word cloud based on the comments for any steemit user

Try out the demo [here](https://evanmarshall.github.io/steemit-cloud/)


## Getting setup
1. Make sure Node and Npm are installed
1. Install yarn: `npm install yarn --global`
1. Install gulp: `npm install gulp --global`
1. Run `gulp build` to produce the output bundle
2 changes: 2 additions & 0 deletions build/js/index.js

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Dependencies
var gulp = require('gulp');
var webpack = require('webpack');
var gutil = require('gulp-util');

// Configurations
var webpackConfig = require('./webpack.config');

var getWebpackCallback = function(cb) {
return function(err, stats) {
if (err)
throw new gutil.PluginError("webpack", err);

gutil.log("[webpack]", stats.toString({
chunks: false, // Makes the build much quieter
colors: true
}));

if (cb) {
if (stats.hasErrors() || stats.hasWarnings())
cb('webpack failed');
else
cb();
}
}
}

gulp.task('compile', function(cb) {
return webpack(webpackConfig).run(getWebpackCallback(cb));
});


gulp.task('watch', function () {
webpack(webpackConfig).watch({}, getWebpackCallback());
});

0 comments on commit 967e783

Please sign in to comment.