Skip to content

Commit

Permalink
Update package.json and use babel preset latest
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfarljw committed Nov 16, 2016
1 parent 3872fc3 commit 2c67c4e
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 104 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["latest"]
}
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
# Directories
/.idea
/nbproject

# Files
*.DS_Store
*.log
/node_modules
97 changes: 97 additions & 0 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import filesystem from 'fs';
import gulp from 'gulp';
import gulpBabel from 'gulp-babel';
import gulpConcat from 'gulp-concat';
import gulpInsert from 'gulp-insert';
import gulpReplace from 'gulp-replace';
import gulpSass from 'gulp-sass';
import gulpUmd from 'gulp-umd';

const buildDate = new Date();
const buildVersion = require('./package.json').version;

gulp.task('build', ['compile-js', 'compile-styles']);

gulp.task('watch', () => gulp.watch('./src/**/*', ['build']));

gulp.task(
'compile-js',
() => {
return gulp
.src(
[
'./src/gelato.js',
'./src/modules/Application.js',
'./src/modules/View.js',
'./src/modules/Cookies.js',
'./src/modules/Collection.js',
'./src/modules/Component.js',
'./src/modules/Dialog.js',
'./src/modules/Locale.js',
'./src/modules/Model.js',
'./src/modules/Page.js',
'./src/modules/Router.js',
'./src/modules/Storage.js'
]
)
.pipe(gulpBabel({presets: ['latest']}))
.pipe(gulpConcat('backbone-gelato.js'))
.pipe(gulpUmd({
namespace: function() {
return 'Gelato';
},
exports: function() {
return 'Gelato';
},
dependencies: function() {
return [
{
name: 'jquery',
amd: 'jquery',
cjs: 'jquery',
global: '$',
param: '$'
},
{
name: 'lodash',
amd: 'lodash',
cjs: 'lodash',
global: '_',
param: '_'
},
{
name: 'backbone',
amd: 'backbone',
cjs: 'backbone',
global: 'Backbone',
param: 'Backbone'
}
];
}
}))
.pipe(gulpInsert.prepend(filesystem.readFileSync('./src/header.js')))
.pipe(gulpReplace('{!date!}', buildDate))
.pipe(gulpReplace('{!version!}', buildVersion))
.pipe(gulp.dest('./dist'));
}
);

gulp.task(
'compile-styles', () => {
return gulp
.src(
[
'./src/styles/application.scss',
'./src/styles/component.scss',
'./src/styles/dialog.scss',
'./src/styles/page.scss'
]
)
.pipe(gulpSass())
.pipe(gulpConcat('backbone-gelato.css'))
.pipe(gulpInsert.prepend(filesystem.readFileSync('./src/header.js')))
.pipe(gulpReplace('{!date!}', buildDate))
.pipe(gulpReplace('{!version!}', buildVersion))
.pipe(gulp.dest('./dist'));
}
);
96 changes: 0 additions & 96 deletions gulpfile.js

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test": "node ./scripts/test.js"
},
"devDependencies": {
"babel-preset-es2015": "~6.18.0",
"babel-preset-latest": "~6.16.0",
"backbone": "~1.3.0",
"chai": "~3.5.0",
"gulp": "~3.9.0",
Expand All @@ -32,7 +32,7 @@
"gulp-umd": "~0.2.0",
"gulp-watch": "~4.3.0",
"jquery": "~3.1.0",
"lodash": "~4.16.0",
"lodash": "~4.17.0",
"mocha": "~3.1.0",
"mocha-phantomjs": "~4.1.0",
"shelljs": "~0.7.0",
Expand Down

0 comments on commit 2c67c4e

Please sign in to comment.