Get gulp working
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -26,7 +26,7 @@ node_modules
|
||||
|
||||
.DS_Store
|
||||
|
||||
vendor/
|
||||
vendor/bower_components
|
||||
|
||||
.idea
|
||||
|
||||
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "vendor/webextension-polyfill"]
|
||||
path = vendor/webextension-polyfill
|
||||
url = https://github.com/mozilla/webextension-polyfill.git
|
||||
24
gulpfile.js
24
gulpfile.js
@@ -1,6 +1,8 @@
|
||||
var del = require('del');
|
||||
var gulp = require('gulp');
|
||||
var elixir = require('laravel-elixir');
|
||||
var exec = require('child_process').exec;
|
||||
var fs = require('fs');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -16,6 +18,19 @@ gulp.task('postinstall', function (cb) {
|
||||
//so we remove them on postinstall
|
||||
del('node_modules/**/*.pem', cb);
|
||||
});
|
||||
gulp.task('webextension',function(cb){
|
||||
exec('npm install',{
|
||||
cwd: 'vendor/webextension-polyfill/'
|
||||
},function(){
|
||||
exec('grunt',{
|
||||
cwd: 'vendor/webextension-polyfill/'
|
||||
},function(){
|
||||
var stream = fs.createWriteStream('public/js/browser-polyfill.min.js');
|
||||
stream.on('done',cb);
|
||||
fs.createReadStream('vendor/webextension-polyfill/dist/browser-polyfill.min.js').pipe(stream);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -30,14 +45,19 @@ gulp.task('postinstall', function (cb) {
|
||||
|
||||
elixir.config.assetsPath = 'assets/';
|
||||
|
||||
elixir.extend('webextension', function(){
|
||||
return gulp.start('webextension');
|
||||
});
|
||||
|
||||
elixir(function (mix) {
|
||||
mix.webextension();
|
||||
mix.copy('vendor/bower_components/bootstrap/less', 'assets/less/bootstrap');
|
||||
mix.copy('vendor/bower_components/bootstrap/fonts', 'public/fonts');
|
||||
/*mix.copy('vendor/bower_components/bootstrap/fonts', 'public/fonts');
|
||||
mix.copy('vendor/bower_components/font-awesome/less', 'assets/less/font-awesome');
|
||||
mix.copy('vendor/bower_components/font-awesome/fonts', 'public/fonts');
|
||||
mix.less('app.less');
|
||||
mix.browserify('app.jsx', 'public/js/app.js', 'assets/js');
|
||||
mix.browserify('events.js', 'public/js/events.js', 'assets/js');
|
||||
mix.browserify('options.jsx', 'public/js/options.js', 'assets/js');
|
||||
mix.browserify('devtools.js', 'public/js/devtools.js', 'assets/js');
|
||||
mix.browserify('devtools.js', 'public/js/devtools.js', 'assets/js');*/
|
||||
});
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
],
|
||||
"background": {
|
||||
"scripts": [
|
||||
"public/js/browser-polyfill.min.js"
|
||||
"public/js/events.js"
|
||||
],
|
||||
"persistent": false
|
||||
@@ -36,7 +37,7 @@
|
||||
"page": "options.html",
|
||||
"chrome_style": false
|
||||
},
|
||||
"applicaitons": {
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"id": "addon@wakatime.com"
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<title>WakaTime</title>
|
||||
|
||||
<link href="public/css/app.css" rel="stylesheet">
|
||||
<script src="public/js/browser-polyfill.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
1
vendor/webextension-polyfill
vendored
Submodule
1
vendor/webextension-polyfill
vendored
Submodule
Submodule vendor/webextension-polyfill added at 77af627d05
Reference in New Issue
Block a user