mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 00:40:56 -05:00
Webpack does things!
This commit is contained in:
parent
6b75fb0a76
commit
ffdce15705
12 changed files with 28319 additions and 15 deletions
24
app/app.js
Normal file
24
app/app.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
// require.context('./core', true, /^.*$/)
|
||||
|
||||
|
||||
global.$ = window.$ = window.jQuery = require('jquery');
|
||||
window._ = require('lodash');
|
||||
window.Backbone = require('backbone');
|
||||
window.Backbone.$ = window.jQuery; //wat
|
||||
window.createjs = require('../vendor/scripts/createjs.combined.js').createjs;
|
||||
window.tv4 = require('tv4');
|
||||
window.lscache = require('lscache');
|
||||
window._.string = require('underscore.string');
|
||||
require('jquery.browser');
|
||||
window.marked = require('marked');
|
||||
require('../bower_components/validated-backbone-mediator/backbone-mediator.js');
|
||||
require('../bower_components/treema/treema.js');
|
||||
window.TreemaUtils = require('../bower_components/treema/treema-utils.js');
|
||||
window.moment = require('moment');
|
||||
window.$.i18n = require('../bower_components/i18next/i18next.js');
|
||||
require('../vendor/scripts/idle.js').createjs;
|
||||
|
||||
|
||||
require('./core/Router.coffee');
|
||||
|
||||
require('core/initialize');
|
|
@ -60,15 +60,15 @@
|
|||
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.2/jquery.xdomainrequest.min.js"></script>
|
||||
<![endif]-->
|
||||
<![if (gt IE 9)|(!IE)]>
|
||||
<script src="/lib/ace/ace.js" defer></script>
|
||||
<!-- <script src="/lib/ace/ace.js" defer></script>
|
||||
<script src="/javascripts/vendor.js" defer></script>
|
||||
<script src="/javascripts/aether.js" defer></script>
|
||||
<script src="/javascripts/aether.js" defer></script> -->
|
||||
<script src="/javascripts/esper.js" defer></script>
|
||||
<script src="/javascripts/app.js" defer></script>
|
||||
<![endif]>
|
||||
<script>
|
||||
|
||||
// IMPORTANT: If you edit here, make sure app/assets/javascripts/run-tests.js puts in placeholders for
|
||||
// IMPORTANT: If you edit here, make sure app/assets/javascripts/run-tests.js puts in placeholders for
|
||||
// running client tests on Travis.
|
||||
|
||||
// Placeholder for iPad, which inspects the user object at the bottom of an injected page.
|
||||
|
|
|
@ -217,7 +217,7 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
|
||||
tryToLoadModule: (path) ->
|
||||
try
|
||||
return require(path)
|
||||
return require('../views/' + path + '.coffee')
|
||||
catch error
|
||||
if error.toString().search('Cannot find module "' + path + '" from') is -1
|
||||
throw error
|
||||
|
@ -248,7 +248,7 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
return if application.testing or application.demoing
|
||||
application.facebookHandler.loadAPI()
|
||||
application.gplusHandler.loadAPI()
|
||||
require('core/services/twitter')()
|
||||
require('./services/twitter')()
|
||||
|
||||
renderSocialButtons: =>
|
||||
# TODO: Refactor remaining services to Handlers, use loadAPI success callback
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
storage = require 'core/storage'
|
||||
etorage = require 'core/storage'
|
||||
deltasLib = require 'core/deltas'
|
||||
locale = require 'locale/locale'
|
||||
|
||||
|
@ -309,7 +309,7 @@ class CocoModel extends Backbone.Model
|
|||
sum = 0
|
||||
data ?= $.extend true, {}, @attributes
|
||||
schema ?= @schema() or {}
|
||||
if schema.oneOf # get populating the Programmable component config to work
|
||||
if schema.oneOf # get populating the Programmable component config to work
|
||||
schema = _.find(schema.oneOf, {type: 'object'})
|
||||
addedI18N = false
|
||||
if schema.properties?.i18n and _.isPlainObject(data) and not data.i18n?
|
||||
|
|
|
@ -13,7 +13,8 @@ module.exports = class Level extends CocoModel
|
|||
editableByArtisans: true
|
||||
|
||||
serialize: (options) ->
|
||||
{supermodel, session, otherSession, @headless, @sessionless, cached=false} = options
|
||||
# {supermodel, session, otherSession, @headless, @sessionless, cached=false} = options
|
||||
{supermodel, session, otherSession, @headless, @sessionless, cached} = options
|
||||
o = @denormalize supermodel, session, otherSession # hot spot to optimize
|
||||
|
||||
# Figure out Components
|
||||
|
|
|
@ -33,7 +33,7 @@ block modal-body-content
|
|||
input.form-control(type="date" name="startDate" value=moment().format('YYYY-MM-DD'))
|
||||
.form-group
|
||||
label End Date
|
||||
input.form-control(type="date" name="endDate" value=moment().add(1, 'year').format('YYYY-MM-DD')))
|
||||
input.form-control(type="date" name="endDate" value=moment().add(1, 'year').format('YYYY-MM-DD'))
|
||||
.form-group
|
||||
button#add-seats-btn.btn.btn-primary Add Licenses
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
span.glyphicon.glyphicon-ok
|
||||
tr
|
||||
td.feature-description
|
||||
span(data-i18n="subscribe.feature3", data-i18n-options='{"bonusLevelsCount": ' + view.i18nData.bonusLevelsCount + '}'))
|
||||
span(data-i18n="subscribe.feature3", data-i18n-options='{"bonusLevelsCount": ' + view.i18nData.bonusLevelsCount + '}')
|
||||
if !me.isOnPremiumServer()
|
||||
td.free-cell
|
||||
td.center-ok
|
||||
|
@ -88,7 +88,7 @@
|
|||
if !me.isOnPremiumServer()
|
||||
button.btn.btn-lg.btn-illustrated.parent-button(data-i18n="subscribe.parent_button")
|
||||
if view.yearProduct
|
||||
button.btn.btn-lg.btn-illustrated.sale-button(data-i18n="[title]subscribe.sale_button_title", data-i18n="subscribe.sale_button")
|
||||
button.btn.btn-lg.btn-illustrated.sale-button(data-i18n="[title]subscribe.sale_button_title subscribe.sale_button")
|
||||
button.btn.btn-lg.btn-illustrated.purchase-button(data-i18n="subscribe.subscribe_title")
|
||||
|
||||
if view.state === 'declined'
|
||||
|
|
27
package.json
27
package.json
|
@ -33,7 +33,6 @@
|
|||
"test": "./node_modules/.bin/karma start",
|
||||
"predeploy": "echo Starting deployment--hold onto your butts.; echo Skipping brunch build --production",
|
||||
"postdeploy": "echo Deployed. Unclench.",
|
||||
"postinstall": "bower install && brunch build --env fast",
|
||||
"brunch": "brunch",
|
||||
"bower": "bower",
|
||||
"dev": "brunch watch --server --env fast",
|
||||
|
@ -52,44 +51,64 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"JQDeferred": "~2.1.0",
|
||||
"ace-builds": "https://github.com/ajaxorg/ace-builds/archive/3fb55e8e374ab02ce47c1ae55ffb60a1835f3055.tar.gz",
|
||||
"ace-builds": "ajaxorg/ace-builds#3fb55e8e374ab02ce47c1ae55ffb60a1835f3055",
|
||||
"aether": "~0.5.21",
|
||||
"algoliasearch": "^3.13.1",
|
||||
"async": "0.2.x",
|
||||
"aws-sdk": "~2.0.0",
|
||||
"backbone": "1.1.0",
|
||||
"bayesian-battle": "0.0.7",
|
||||
"bluebird": "^3.2.1",
|
||||
"bootstrap": "~3.2.0",
|
||||
"chalk": "^1.1.3",
|
||||
"co": "^4.6.0",
|
||||
"co-express": "^1.2.1",
|
||||
"coffee-loader": "^0.7.2",
|
||||
"coffee-script": "1.9.x",
|
||||
"connect": "2.7.x",
|
||||
"country-list": "0.0.3",
|
||||
"d3": "~3.4.4",
|
||||
"esper.js": "codecombat/esper.js",
|
||||
"express": "~3.0.6",
|
||||
"express-useragent": "~0.0.9",
|
||||
"fastclick": "~1.0.3",
|
||||
"firepad": "~0.1.2",
|
||||
"geoip-lite": "^1.1.6",
|
||||
"graceful-fs": "~2.0.1",
|
||||
"gridfs-stream": "~1.1.1",
|
||||
"jade": "^1.11.0",
|
||||
"jade-loader": "^0.8.0",
|
||||
"jquery": "~2.1.0",
|
||||
"jquery-mousewheel": "~3.1.9",
|
||||
"jquery.browser": "~0.0.6",
|
||||
"jsondiffpatch": "^0.2.3",
|
||||
"lodash": "~2.4.1",
|
||||
"lscache": "~1.0.5",
|
||||
"lz-string": "^1.3.3",
|
||||
"mailchimp-api": "2.0.x",
|
||||
"marked": "~0.3.0",
|
||||
"moment": "~2.5.0",
|
||||
"mongodb": "^2.0.28",
|
||||
"mongoose": "4.5.3",
|
||||
"mongoose-cache": "https://github.com/nwinter/mongoose-cache/tarball/master",
|
||||
"mongoose-cache": "nwinter/mongoose-cache#master",
|
||||
"mysql": "^2.11.1",
|
||||
"nanoscroller": "~0.8.0",
|
||||
"node-force-domain": "~0.1.0",
|
||||
"node-gyp": "~0.13.0",
|
||||
"node-statsd": "^0.1.1",
|
||||
"npm-modernizr": "~2.8.3",
|
||||
"passport": "0.1.x",
|
||||
"passport-local": "0.1.x",
|
||||
"promise-polyfill": "^5.2.1",
|
||||
"redis": "",
|
||||
"request": "^2.69.0",
|
||||
"sendwithus": "2.1.x",
|
||||
"stream-buffers": "0.2.x",
|
||||
"stripe": "~2.9.0",
|
||||
"three": "",
|
||||
"tv4": "~1.0.16",
|
||||
"underscore.string": "2.3.x",
|
||||
"underscore.string": "~2.3.3",
|
||||
"webpack": "^1.13.2",
|
||||
"winston": "0.6.x"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
26923
vendor/scripts/createjs.combined.js
vendored
Normal file
26923
vendor/scripts/createjs.combined.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
1304
webpack-bundle.js
Normal file
1304
webpack-bundle.js
Normal file
File diff suppressed because it is too large
Load diff
1
webpack-bundle.js.map
Normal file
1
webpack-bundle.js.map
Normal file
File diff suppressed because one or more lines are too long
32
webpack.config.js
Normal file
32
webpack.config.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
var path = require('path');
|
||||
var webpack = require('webpack');
|
||||
|
||||
module.exports = {
|
||||
entry: './app/app.js',
|
||||
output: {
|
||||
filename: './public/javascripts/app.js'
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /\.coffee$/, loader: 'coffee-loader' },
|
||||
{ test: /\.jade$/, loader: 'jade-loader', query: { root: path.resolve('./app') } }
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
root: [path.resolve('./app'), path.resolve('./app/templates')],
|
||||
extensions: ['', '.web.coffee', '.web.js', '.coffee', '.js', '.jade']
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ContextReplacementPlugin(/./, function(context){
|
||||
if (context.resource === path.resolve('./app/views')) {
|
||||
context.regExp = /home/i
|
||||
}
|
||||
console.log(arguments);
|
||||
}),
|
||||
new webpack.NormalModuleReplacementPlugin(/.*templates.*/, function(context){
|
||||
if(context.request.indexOf('.jade') < 0){
|
||||
context.request += '.jade';
|
||||
}
|
||||
}),
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue