1
1
Fork 0
mirror of https://gitlab.com/Oreolek/cloak-salet.git synced 2024-06-28 21:05:06 +03:00

concatenate coffee files

This commit is contained in:
Alexander Yakovlev 2017-12-04 23:09:53 +07:00
parent ea8cdea514
commit 712a4f52e4
4 changed files with 24 additions and 5 deletions

3
.gitignore vendored
View file

@ -1,4 +1,5 @@
node_modules
build
dist
dist.zip
dist.zip
/src/game/index.coffee

View file

@ -1,3 +1,6 @@
marked = require('marked')
salet = require('salet')
salet.game_id = "8b0c371c-57f4-49b3-ae3c-cba07d1a9733"
salet.game_version = "1.0"
salet.verbRe = /^verb\_(\w+)\_(\w+)$/
@ -17,12 +20,14 @@ salet.beforeAction = (room, actionId) ->
salet.afterAction = () ->
salet.character.update_sidebar()
###
$.holdReady( true )
$.getJSON('game/translations/'+i18n.lang+'.json', (data) ->
i18n.push(i18n.lang, data)
$.holdReady( false )
)
###
switchTab = (tabid) ->
$(".tab").removeClass("active")

View file

@ -46,10 +46,8 @@
</div>
</div> <!-- End of div.page -->
<link rel='prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.5/marked.min.js' />
<link rel='prefetch' href="https://code.jquery.com/jquery-3.1.1.min.js" />
<link rel='prefetch' href="https://cdnjs.cloudflare.com/ajax/libs/sigma.js/1.2.0/sigma.min.js" />
<link rel='prefetch' href="game/salet.min.js" />
<link rel='prefetch' href="https://togetherjs.com/togetherjs-min.js" />
</body>
</html>

View file

@ -1,10 +1,25 @@
const path = require('path');
const fs = require('fs');
let sources = [
'./src/game/begin.coffee',
'./src/game/story.coffee',
];
let out = "";
for (let i = 0;i < sources.length; i++) {
out = out + fs.readFileSync(sources[i]);
}
fs.writeFileSync('./src/game/index.coffee');
let outdir = 'build';
if (process.env.NODE_ENV === 'production') {
outdir = 'dist';
}
module.exports = {
entry: './src/game/index.coffee',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
filename: 'game/bundle.js',
path: path.resolve(__dirname, outdir)
},
resolve: {
extensions: ['.cson']