diff --git a/Gruntfile.js b/Gruntfile.js index 19a54599..5f3e4475 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,7 +9,7 @@ module.exports = function (grunt) { data: { debug: false, files: { - 'tmp/html/all.html': ['views/**/*.jade'] + 'tmp/html/all.html': ['res/app/**/*.jade'] } } @@ -20,7 +20,7 @@ module.exports = function (grunt) { nggettext_extract: { pot: { files: { - 'lang/po/template.pot': ['tmp/html/all.html', 'public/js/controllers/**/*.js'] + 'res/lang/po/template.pot': ['tmp/html/all.html', 'res/app/**/*.js'] } } }, @@ -28,7 +28,7 @@ module.exports = function (grunt) { nggettext_compile: { all: { files: { - 'public/js/lang/translations.js': ['lang/po/*.po'] + 'res/lang/translations.js': ['res/lang/po/*.po'] } } } diff --git a/lib/cli.js b/lib/cli.js index 3ae64234..5b96b6ec 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -445,9 +445,9 @@ program , 'provider name (or os.hostname())' , String , os.hostname()) - .option('-w, --resources-watch' + .option('-dw, --disable-watch' , Boolean - , process.env.RESOURCES_WATCH) + , process.env.DISABLE_WATCH) .action(function() { var log = logger.createLogger('cli') , options = cliutil.lastArg(arguments) diff --git a/lib/roles/app.js b/lib/roles/app.js index dfd3e18d..8ba76876 100644 --- a/lib/roles/app.js +++ b/lib/roles/app.js @@ -35,10 +35,14 @@ module.exports = function(options) { io.set('log level', 1) io.set('browser client', false) + app.use(express.compress()) + app.use('/static/lib', express.static(pathutil.resource('lib'))) app.use('/static', express.static(pathutil.resource('app'))) - app.use(require('./webpack-config')) + if (!options.disableWatch) { + app.use(require('./webpack-config')) + } app.use(express.cookieParser(options.secret)) app.use(express.cookieSession({ diff --git a/lib/roles/webpack-config.js b/lib/roles/webpack-config.js index 15d6cc86..0448fc06 100644 --- a/lib/roles/webpack-config.js +++ b/lib/roles/webpack-config.js @@ -3,10 +3,9 @@ var webpack = require('webpack') var pathutil = require('../util/pathutil') -module.exports = webpackMiddleware(webpack({ +var webpackConfig = webpackMiddleware(webpack({ cache: true, debug: true, -// devtool: 'eval-source-map', devtool: 'eval', entry: pathutil.resource('app') + '/app.js', output: { @@ -16,7 +15,7 @@ module.exports = webpackMiddleware(webpack({ resolve: { modulesDirectories: [ pathutil.resource('lib'), - pathutil.resource('app') + '/components', + pathutil.resource('app') + '/components', 'web_modules', './../../node_modules' ], @@ -44,9 +43,6 @@ module.exports = webpackMiddleware(webpack({ new webpack.ResolverPlugin( new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('.bower.json', ['main']) ) -// new webpack.ProvidePlugin({ -// angular: 'angular' -// }) //new webpack.optimize.UglifyJsPlugin() ] }), { @@ -58,3 +54,5 @@ module.exports = webpackMiddleware(webpack({ colors: true } }) + +module.exports = webpackConfig \ No newline at end of file diff --git a/res/app/app-styles.js b/res/app/app-styles.js deleted file mode 100644 index e69de29b..00000000 diff --git a/res/app/app.js b/res/app/app.js index f941f3fa..4820a960 100644 --- a/res/app/app.js +++ b/res/app/app.js @@ -1,8 +1,6 @@ require('angular') require('angular-route') -require('./app-styles') - angular.module('app', [ 'ngRoute', require('./device-list').name,