diff --git a/gulpfile.js b/gulpfile.js index 5fc604a..e33b325 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -17,11 +17,6 @@ var config = { dest: 'webapp/dist/' } -config.browserify = browserify({ - entries: config.files.mainJs, - transform: [ reactify ] -}) - gulp.task('css',function(){ gulp.src(config.files.css) .pipe(minifyCss()) @@ -34,7 +29,9 @@ gulp.task('html',function(){ }) gulp.task('js',function(){ - config.browserify.bundle() + browserify(config.files.mainJs) + .transform('babelify', { presets: [ 'es2015', 'react' ]}) + .bundle() .on('error', console.error.bind(console)) .pipe(source('app.js')) // do this or browserify won't work .pipe(buffer()) // do this or uglify won't work diff --git a/package.json b/package.json index df889c3..16d6634 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,9 @@ "author": "Enrico Fasoli (fazo96)", "license": "MIT", "dependencies": { + "babel-preset-es2015": "^6.1.18", + "babel-preset-react": "^6.1.18", + "babelify": "^7.2.0", "browserify": "^12.0.1", "commander": "^2.9.0", "express": "^4.13.3", @@ -28,7 +31,8 @@ "gulp-uglify": "^1.5.1", "ipfs-api": "^2.6.2", "moment": "^2.10.6", - "reactify": "^1.1.1", + "react": "^0.14.2", + "react-dom": "^0.14.2", "vinyl-buffer": "^1.0.0", "vinyl-source-stream": "^1.1.0" } diff --git a/webapp/app.js b/webapp/app.js index f7d9816..e69de29 100644 --- a/webapp/app.js +++ b/webapp/app.js @@ -1,22 +0,0 @@ -var boards = angular.module('boards',['ui.router']) - -boards.config(function($stateProvider,$urlRouterProvider,$locationProvider){ - $urlRouterProvider.otherwise('/') - //$locationProvider.html5Mode({ enabled: true, requireBase: false }) - - $stateProvider.state('home',{ - url: '/', - templateUrl: 'home.html', - controller: function($scope){ - - } - }) - - $stateProvider.state('board',{ - url: '/board/:name', - templateUrl: 'board.html', - controller: function($scope,$stateParams){ - $scope.posts = [ "hey", "test", "something" ] - } - }) -})