diff --git a/gulp/tasks/copy.js b/gulp/tasks/copy.js index 411f79c..050cfa4 100644 --- a/gulp/tasks/copy.js +++ b/gulp/tasks/copy.js @@ -3,15 +3,15 @@ import rename from 'gulp-rename'; const copy = (dest, manifest) => () => { if (manifest) { - gulp.src(`./src/browser/${manifest}`) + gulp.src(`./src/${manifest}`) .pipe(rename('manifest.json')) .pipe(gulp.dest(dest)); } gulp.src('./src/assets/**/*').pipe(gulp.dest(dest)); }; -gulp.task('copy:dev', copy('./dev', 'extension/manifest.dev.json')); -gulp.task('copy:build:extension', copy('./build/extension', 'extension/manifest.prod.json')); +gulp.task('copy:dev', copy('./dev', 'browser/extension/manifest.dev.json')); +gulp.task('copy:build:extension', copy('./build/extension', 'browser/extension/manifest.prod.json')); gulp.task('copy:build:app', copy('./build/app', 'chromeApp/manifest.json')); gulp.task('copy:build:web', copy('./build/web')); diff --git a/gulp/tasks/views.js b/gulp/tasks/views.js index 70ddd04..c7be44c 100644 --- a/gulp/tasks/views.js +++ b/gulp/tasks/views.js @@ -1,17 +1,22 @@ import gulp from 'gulp'; import jade from 'gulp-jade'; -const compile = (dest, p = 0, env = 'prod') => () => { +const paths = ['./src/browser/views/*.jade', './src/views/*.jade']; + +const compile = (dest, path, env = 'prod') => () => { const paths = ['./src/browser/views/*.jade', './src/views/*.jade']; - gulp.src(p === 'all' ? paths : paths[p]) + gulp.src(path) .pipe(jade({ locals: { env } })) .pipe(gulp.dest(dest)); }; -gulp.task('views:dev', compile('./dev', 'all', 'dev')); -gulp.task('views:build:extension', compile('./build/extension')); -gulp.task('views:build:app', compile('./build/app')); -gulp.task('views:build:electron', compile('./build/electron', 1)); -gulp.task('views:build:web', compile('./build/web', 1)); +gulp.task('views:dev', compile('./dev', paths, 'dev')); +gulp.task('views:build:extension', compile('./build/extension', paths[0])); +gulp.task('views:build:app', () => { + compile('./build/app', paths[1])(); + compile('./build/app', './src/browser/views/background.jade')(); +}); +gulp.task('views:build:electron', compile('./build/electron', paths[1])); +gulp.task('views:build:web', compile('./build/web', paths[1])); diff --git a/src/chromeApp/index.js b/src/chromeApp/index.js index c97c7cf..be50dcc 100644 --- a/src/chromeApp/index.js +++ b/src/chromeApp/index.js @@ -1,11 +1,6 @@ -import configureStore from '../../app/store/configureStore'; - -configureStore(store => { - window.store = store; - chrome.app.runtime.onLaunched.addListener(function () { - chrome.app.window.create('window.html', { - 'state': 'maximized' - // More parameters: https://developer.chrome.com/apps/app_window#CreateWindowOptions - }); +chrome.app.runtime.onLaunched.addListener(function () { + chrome.app.window.create('index.html', { + 'state': 'normal' + // More parameters: https://developer.chrome.com/apps/app_window#CreateWindowOptions }); -}, true); +}); diff --git a/webpack/app.config.js b/webpack/app.config.js index 9fa63fe..d3e4c6e 100644 --- a/webpack/app.config.js +++ b/webpack/app.config.js @@ -3,8 +3,8 @@ import baseConfig from './base.config'; export default baseConfig({ input: { - background: [path.join(__dirname, '../src/browser/chromeApp/index')], - window: [path.join(__dirname, '../src/browser/window/index')] + background: [path.join(__dirname, '../src/chromeApp/index')], + app: [path.join(__dirname, '../src/web/index')] }, output: { path: path.join(__dirname, '../build/app/js')