From 84e487ee80e7c1e3046fbfcc30ba82281abb566b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Thu, 29 Nov 2018 14:47:49 +0100 Subject: [PATCH] index js bundle --- src/index.coffee | 21 +++++++++++++++++++++ src/index.js | 6 ------ src/scripts/index/10-init-framework.coffee | 10 ---------- webpack.config.js | 2 +- 4 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 src/index.coffee delete mode 100644 src/index.js delete mode 100644 src/scripts/index/10-init-framework.coffee diff --git a/src/index.coffee b/src/index.coffee new file mode 100644 index 0000000..df09196 --- /dev/null +++ b/src/index.coffee @@ -0,0 +1,21 @@ +# libs +window.$ = require('jquery') + +# on load +$ -> + # libs requiring full DOM + io = require 'socket.io-client' + + # style sheet + require './style/custom.scss' + + # init Socket.IO + socket = io() + + $('form[name="fftcg-login"]').submit -> + data = + uname: $('input[name="uname"]').val() + password: $('input[name="password"]').val() + @reset() + socket.emit 'login', data + false diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 3619e41..0000000 --- a/src/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import $ from 'jquery' - -// import 'bootstrap' -import 'bootstrap/js/dist/carousel' - -import './style/custom.scss' diff --git a/src/scripts/index/10-init-framework.coffee b/src/scripts/index/10-init-framework.coffee deleted file mode 100644 index d7db864..0000000 --- a/src/scripts/index/10-init-framework.coffee +++ /dev/null @@ -1,10 +0,0 @@ -# init Socket.IO -socket = io() - -$('form[name="fftcg-login"]').submit -> - data = - uname: $('input[name="uname"]').val() - password: $('input[name="password"]').val() - @reset() - socket.emit 'login', data - false diff --git a/webpack.config.js b/webpack.config.js index f196f95..25512da 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,7 +4,7 @@ module.exports = { mode: 'development', entry: { - index: './src/index.js', + index: './src/index.coffee', game: './src/game.coffee' },