Skip to content

Commit

Permalink
update Gruntfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Sep 13, 2014
1 parent d2475e6 commit 7b74d20
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ libpathod

node_modules
bower_components
*.compiled.js
*.map
4 changes: 4 additions & 0 deletions web/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"loopfunc": true,
"esnext": true
}
38 changes: 23 additions & 15 deletions web/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
var cssfiles = {
"../libmproxy/web/static/mitmproxy.css": "src/css/mitmproxy.less",
"../libmproxy/web/static/css/app.css": "src/css/app.less",
"../libmproxy/web/static/css/vendor.css": "src/css/vendor.less",
};
var jsfiles = {
"../libmproxy/web/static/mitmproxy.js": [
"../libmproxy/web/static/js/vendor.js": [
'src/vendor/jquery/jquery.js',
'src/vendor/lodash/dist/lodash.js',
'src/vendor/lodash/lodash.js',
'src/vendor/react/react-with-addons.js',
'src/vendor/react-router/dist/react-router.js',
'src/vendor/bootstrap-customized.js',
'src/js/router_jsx.js',
'src/js/certinstall_jsx.js',
'src/js/mitmproxy.js',
'src/vendor/react-router/react-router.js',
'src/vendor/react-bootstrap/react-bootstrap.js',
],
"../libmproxy/web/static/js/app.js": [
'src/js/datastructures.compiled.js',
'src/js/footer.compiled.js',
'src/js/header.compiled.js',
'src/js/mitmproxy.compiled.js',
],
};

Expand All @@ -24,7 +28,7 @@ module.exports = function (grunt) {
{
expand: true,
flatten: true,
src: ['src/vendor/fontawesome/fonts/*'],
src: ['src/vendor/fontawesome/fontawesome-webfont.*'],
dest: '../libmproxy/web/static/fonts'
}
],
Expand Down Expand Up @@ -52,17 +56,21 @@ module.exports = function (grunt) {
files: [{
expand: true,
cwd: 'src/js',
src: ['*.jsx'],
src: ['*.react.js','*.es6.js'],
dest: 'src/js',
ext: '_jsx.js'
ext: '.compiled.js'
}]
},
options: {
harmony: true
}
},
uglify: {
dev: {
options: {
mangle: false,
compress: false,
beautify: true,
sourceMap: true,
sourceMapIncludeSources: true,
},
Expand All @@ -78,24 +86,24 @@ module.exports = function (grunt) {
},
jshint: {
options: {
loopfunc: true,
jshintrc: ".jshintrc",
},
all: ['src/js/*.js'],
all: ['src/js/*.js','!src/js/*.react.js'],
gruntfile: ['Gruntfile.js']
},
qunit: {
all: ['src/test.html']
},
watch: {
less: {
files: ['src/css/*.less', 'src/css/*.css'],
files: ['src/css/**'],
tasks: ['less:dev'],
options: {
livereload: true,
}
},
jsx: {
files: ['src/js/*.jsx'],
files: ['src/js/*.react.js','src/js/*.es6.js'],
tasks: ['react:all'],
},
js: {
Expand Down
2 changes: 1 addition & 1 deletion web/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var path = {
'vendor/react-bootstrap/react-bootstrap.js'
],
app: [
'js/datastructures.js',
'js/datastructures.es6.js',
'js/footer.react.js',
'js/header.react.js',
'js/mitmproxy.react.js',
Expand Down
1 change: 1 addition & 0 deletions web/src/css/footer.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
footer {
padding: 0 10px;
text-align: center;
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DummyFlowStore extends FlowStore {
}


SETTINGS_CHANGED = "settings.change";
var SETTINGS_CHANGED = "settings.change";

class Settings extends EventEmitter {
constructor(){
Expand Down
3 changes: 0 additions & 3 deletions web/src/js/footer.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

var Footer = React.createClass({
render : function(){
var style = {
textAlign: "center"
};
return (<footer>
<span className="label label-success">transparent mode</span>
</footer>);
Expand Down
2 changes: 1 addition & 1 deletion web/src/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<script src="vendor/jquery/jquery.js"></script>
<script src="vendor/underscore/underscore.js"></script>
<script src="vendor/lodash/dist/lodash.js"></script>
<script src="js/datastructures.js"></script>
<script src="js/datastructures.es6.js"></script>
<script src="js/scurve.js"></script>
<script src="js/entropy.js"></script>
<script src="js/orders.js"></script>
Expand Down

0 comments on commit 7b74d20

Please sign in to comment.