mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-30 22:06:45 -04:00
browserify things
This commit is contained in:
+11
-2
@@ -31,7 +31,16 @@ gulp.task('inlineHtml', ['clean', 'browserify'], function() {
|
||||
jsSelector: 'script[uglify]'
|
||||
}))
|
||||
.pipe(minifyHTML())
|
||||
.pipe(gulp.dest('dist/'));
|
||||
.pipe(gulp.dest('tmp/'));
|
||||
});
|
||||
|
||||
gulp.task('default', ['inlineHtml']);
|
||||
gulp.task('clay', ['inlineHtml'], function() {
|
||||
return browserify('index.js', { debug: false })
|
||||
.transform(stringify(['.html', '.mustache']))
|
||||
.require(require.resolve('./index'), {expose: 'pebble-clay'})
|
||||
.bundle()
|
||||
.pipe(source('clay.js'))
|
||||
.pipe(gulp.dest('./dist/'));
|
||||
});
|
||||
|
||||
gulp.task('default', ['clay']);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var configPageHtml = require('./dist/config-page.html');
|
||||
var configPageHtml = require('./tmp/config-page.html');
|
||||
|
||||
function encodeDataUri(input) {
|
||||
if (window.btoa) {
|
||||
|
||||
@@ -4,8 +4,6 @@ var browserify = require('browserify');
|
||||
var source = require('vinyl-source-stream');
|
||||
var gulp = require('gulp');
|
||||
var path = require('path');
|
||||
var template = require('gulp-template');
|
||||
var stringify = require('stringify');
|
||||
var del = require('del');
|
||||
|
||||
var projectPath = process.argv[2] || process.cwd();
|
||||
@@ -19,16 +17,11 @@ gulp.task('clean', function() {
|
||||
return del([pebbleJsPath]);
|
||||
});
|
||||
|
||||
gulp.task('build', ['clean', 'pebble-js-app'], function() {
|
||||
|
||||
});
|
||||
|
||||
gulp.task('pebble-js-app', function() {
|
||||
gulp.task('pebble-js-app', ['clean'], function() {
|
||||
browserify(clayJsPath, { debug: false })
|
||||
.transform(stringify(['.html', '.mustache']))
|
||||
.bundle()
|
||||
.pipe(source('pebble-js-app.js'))
|
||||
.pipe(gulp.dest('./src/js/'));
|
||||
});
|
||||
|
||||
gulp.start('build');
|
||||
gulp.start('pebble-js-app');
|
||||
|
||||
+4
-2
@@ -2,12 +2,13 @@
|
||||
"name": "pebble-clay",
|
||||
"version": "1.0.0",
|
||||
"description": "Pebble Config Framework",
|
||||
"main": "index.js",
|
||||
"main": "dist/clay.js",
|
||||
"directories": {
|
||||
"example": "example"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
"test": "mocha",
|
||||
"build": "gulp"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -33,6 +34,7 @@
|
||||
"browserify-mustache": "0.0.4",
|
||||
"del": "^2.0.2",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-html-to-js": "0.0.1",
|
||||
"gulp-inline": "0.0.15",
|
||||
"gulp-minify-html": "^1.0.4",
|
||||
"gulp-minify-inline": "^0.1.1",
|
||||
|
||||
@@ -15,6 +15,6 @@
|
||||
<body>
|
||||
<form id="main-form"></form>
|
||||
<script src="../vendor/pebble-slate/dist/js/slate.min.js"></script>
|
||||
<script uglify src="../tmp/config-page.js"></script>
|
||||
<script src="../tmp/config-page.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user