mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-05-31 18:28:28 +02:00
Used browserify for clientside js
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
public/js/
|
||||||
*.log
|
*.log
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
|
grunt.initConfig({
|
||||||
|
|
||||||
|
browserify: {
|
||||||
|
dev: {
|
||||||
|
files: {
|
||||||
|
'public/js/app.js': ['app/client/**/*.js'],
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
browserifyOptions: {
|
||||||
|
debug: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pro: {
|
||||||
|
files: {
|
||||||
|
'public/js/app.js': ['app/client/**/*.js'],
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
browserifyOptions: {
|
||||||
|
debug: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
grunt.loadNpmTasks('grunt-browserify');
|
||||||
|
|
||||||
|
grunt.registerTask('build', ['browserify:pro']);
|
||||||
|
grunt.registerTask('debug', ['browserify:dev']);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -30,12 +30,6 @@ app.factory('buffer', function() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CONTROLLERS
|
* CONTROLLERS
|
||||||
*/
|
*/
|
||||||
@@ -19,18 +19,15 @@ var io = require('socket.io')(server);
|
|||||||
require('./sockets')(io);
|
require('./sockets')(io);
|
||||||
|
|
||||||
|
|
||||||
|
// send homepage
|
||||||
|
app.get('/', function(req, res) {
|
||||||
// handle root requests
|
res.sendFile(path.join(__dirname, '../../public/templates/index.html'));
|
||||||
app.get('/', function(req, res, next) {
|
|
||||||
res.sendFile(path.join(__dirname, '/../views/index.html'));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// public folder serves static content
|
// public folder serves static content
|
||||||
app.use('/', express.static('public'));
|
app.use('/', express.static(path.join(__dirname, '../../public')));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Executable → Regular
+2
@@ -6,6 +6,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "^2.1.3",
|
"debug": "^2.1.3",
|
||||||
"express": "^4.12.3",
|
"express": "^4.12.3",
|
||||||
|
"grunt": "^0.4.5",
|
||||||
|
"grunt-browserify": "^3.7.0",
|
||||||
"mineflayer": "^1.1.0",
|
"mineflayer": "^1.1.0",
|
||||||
"socket.io": "^1.3.5"
|
"socket.io": "^1.3.5"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
||||||
<script src="/js/lib/socket.io.js"></script>
|
<script src="/lib/socket.io.js"></script>
|
||||||
<script src="/js/app.js"></script>
|
<script src="/js/app.js"></script>
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user