mirror of
https://github.com/Oreolek/raconteur-scaffold.git
synced 2024-06-17 07:10:48 +03:00
Remove exportUndum() hack
This commit is contained in:
parent
7d3d5c2c27
commit
7d991e2fa5
3
CHANGES.md
Normal file
3
CHANGES.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# 2015-04-30
|
||||
|
||||
- Removed exportUndum() from scaffold. That functionality has been deprecated in Raconteur itself, and making sure there is only one Undum object is now the responsibility of the build system. The Gulpfile in this scaffold now corrects for this, so problem solved.
|
30
Gulpfile.js
30
Gulpfile.js
|
@ -49,6 +49,15 @@ gulp.task('less', function () {
|
|||
.pipe(gulp.dest('./build/css'));
|
||||
});
|
||||
|
||||
/* Bundle libraries */
|
||||
|
||||
var undumBundler = browserify({debug: true});
|
||||
undumBundler.require('undum-commonjs');
|
||||
|
||||
gulp.task('buildUndum', function () {
|
||||
return undumBundler.bundle().pipe(source('undum.js')).pipe(gulp.dest('./build/game'));
|
||||
});
|
||||
|
||||
/* Generate JavaScript with browser sync. */
|
||||
|
||||
var customOpts = {
|
||||
|
@ -59,8 +68,9 @@ var customOpts = {
|
|||
|
||||
var opts = _.assign({}, watchify.args, customOpts);
|
||||
var bundler = watchify(browserify(opts));
|
||||
bundler.external('undum-commonjs');
|
||||
|
||||
gulp.task('coffee', bundle); // `gulp coffee` will generate bundle
|
||||
gulp.task('coffee', ['buildUndum'], bundle); // `gulp coffee` will generate bundle
|
||||
bundler.on('update', bundle); // Re-bundle on dep updates
|
||||
bundler.on('log', gutil.log); // Output build logs to terminal
|
||||
|
||||
|
@ -102,6 +112,16 @@ gulp.task('serve', ['build'], function () {
|
|||
|
||||
/* Distribution tasks */
|
||||
|
||||
var undumDistBundler = browserify();
|
||||
undumDistBundler.require('undum-commonjs');
|
||||
|
||||
gulp.task('undum-dist', function () {
|
||||
return undumDistBundler.bundle().pipe(source('undum.js'))
|
||||
.pipe(buffer())
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest('./dist/game'));
|
||||
});
|
||||
|
||||
gulp.task('html-dist', html('./dist'));
|
||||
gulp.task('img-dist', img('./dist/img'));
|
||||
|
||||
|
@ -118,11 +138,13 @@ var distBundler = browserify({
|
|||
transform: ['coffeeify']
|
||||
});
|
||||
|
||||
gulp.task('coffee-dist', function () {
|
||||
distBundler.external('undum-commonjs');
|
||||
|
||||
gulp.task('coffee-dist', ['undum-dist'], function () {
|
||||
return distBundler.bundle()
|
||||
.pipe(source('bundle.js'))
|
||||
.pipe(buffer())
|
||||
.pipe(uglify())
|
||||
//.pipe(buffer())
|
||||
//.pipe(uglify())
|
||||
.on('error', gutil.log)
|
||||
.pipe(gulp.dest('./dist/game'));
|
||||
});
|
||||
|
|
|
@ -11,7 +11,7 @@ so this copyright notice may be removed and replaced with your own.
|
|||
# Require the libraries we rely on
|
||||
|
||||
situation = require('raconteur')
|
||||
situation.exportUndum() # Ensures our Undum object is the same as Raconteur's
|
||||
undum = require('undum-commonjs')
|
||||
$ = require('jquery')
|
||||
oneOf = require('raconteur/lib/oneOf.js')
|
||||
elements = require('raconteur/lib/elements.js')
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="css/main.css">
|
||||
<script type="text/javascript" src="game/undum.js"></script>
|
||||
<script type="text/javascript" src="game/bundle.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"undum": "git://github.com/sequitur/undum.git#commonjs",
|
||||
"raconteur": "git://github.com/sequitur/raconteur.git#879543b4a9e773f61f439bbe1700cbf1e994ab4a",
|
||||
"raconteur": "git://github.com/sequitur/raconteur.git#61f60d3097b996c5ad9422bfbe3098c060ae92a1",
|
||||
"jquery": "^2.1.3",
|
||||
"markdown-it": "^4.1.0"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue