clean up development config

This commit is contained in:
Eric Hulburd
2016-02-09 11:16:49 -06:00
parent 109ad432bb
commit a334afbc01
20 changed files with 170 additions and 111 deletions

View File

@@ -0,0 +1,17 @@
import fs from 'fs';
const CONTROLLER_DIR = __dirname + '/../controllers';
class Controllers {
static sync(){
fs.readdirSync(CONTROLLER_DIR).forEach(function(file) {
var controller = require(CONTROLLER_DIR + '/' + file);
Controllers[controller.NAME] = controller;
});
return true;
}
}
export default Controllers;

View File

@@ -10,15 +10,15 @@ var sequelize = new Sequelize("postgres://spikeuser:123456@localhost:5432/spike2
idle: 10000
}
});
const model_dir = __dirname + '/../models'
const MODEL_DIR = __dirname + '/../models'
class Database {
static sync(){
console.log("syncing db")
fs.readdirSync(model_dir).forEach(function(file) {
var model = require(model_dir + '/' + file);
Database[model.name] = model;
fs.readdirSync(MODEL_DIR).forEach(function(file) {
var model = require(MODEL_DIR + '/' + file);
Database[model.NAME] = model;
Database.models.push(model);
});

View File

@@ -1,5 +1,7 @@
export default {
var config = {
modules: 'es6',
'target-version': '0.14.3',
'suffix': '.rt'
targetVersion: '0.14.0',
suffix: '.rt'
};
export default config;

View File

@@ -1,3 +1,5 @@
import webpack from 'webpack';
const ROOT = __dirname + '/../../../';
module.exports = {
@@ -17,21 +19,20 @@ module.exports = {
loaders: [
{
test: /\.scss$/,
loader: ['style', 'raw', 'sass']
loaders: ['style', 'raw', 'sass']
}, {
test: /\.css$/,
loader: ['style', 'raw']
loaders: ['style', 'raw']
}, {
test: /\.js$/,
loader: 'babel'
}
]
},
sassLoader: {
includePaths: [ROOT + 'client', ROOT + 'node_modules']
},
// Use the plugin to specify the resulting filename (and add needed behavior to the compiler)
plugins: [
new ExtractTextPlugin("style.css", {
allChunks: true
}),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",