Skip to content

Commit

Permalink
Web app is now an entry point for other apps
Browse files Browse the repository at this point in the history
  • Loading branch information
zalmoxisus committed Mar 16, 2016
1 parent c67ea3a commit 150ae3d
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 35 deletions.
2 changes: 1 addition & 1 deletion gulp/tasks/build.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import gulp from 'gulp';
import gutil from 'gulp-util';
import webpack from 'webpack';
import prodConfig from '../../webpack/prod.config';
import prodConfig from '../../webpack/extension.config';
import appConfig from '../../webpack/app.config';
import electronConfig from '../../webpack/electron.config';
import webConfig from '../../webpack/web.config';
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions webpack/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import baseConfig from './base.config';

export default baseConfig({
input: {
background: [path.join(__dirname, '../src/chromeApp/index')],
app: [path.join(__dirname, '../src/web/index')]
background: [path.join(__dirname, '../src/chromeApp/')],
app: [path.join(__dirname, '../src/app')]
},
output: {
path: path.join(__dirname, '../build/app')
Expand Down
11 changes: 2 additions & 9 deletions webpack/base.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import path from 'path';
import webpack from 'webpack';

const srcPath = path.join(__dirname, '../src/browser/');

const baseConfig = ({ input, output = {}, globals = {}, plugins, loaders, entry = [] }) => ({
entry: input || {
background: [`${srcPath}extension/background/index`, ...entry],
window: [`${srcPath}window/index`, ...entry],
popup: [`${srcPath}extension/popup/index`, ...entry],
inject: [`${srcPath}extension/inject/index`, ...entry]
},
const baseConfig = ({ input, output = {}, globals = {}, plugins, loaders }) => ({
entry: input,
output: {
filename: 'js/[name].bundle.js',
chunkFilename: 'js/[id].chunk.js',
Expand Down
2 changes: 1 addition & 1 deletion webpack/cordova.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import baseConfig from './base.config';

export default baseConfig({
input: {
app: [path.join(__dirname, '../src/web/index')]
app: [path.join(__dirname, '../src/app/')]
},
output: {
path: path.join(__dirname, '../www')
Expand Down
13 changes: 6 additions & 7 deletions webpack/dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const srcPath = path.join(__dirname, '../src/browser/');

const config = baseConfig({
input: {
background: [`${srcPath}extension/background/index`, ...entry],
window: [`${srcPath}window/index`, ...entry],
popup: [`${srcPath}extension/popup/index`, ...entry],
inject: [`${srcPath}extension/inject/index`, ...entry],
app: [path.join(__dirname, '../src/web/index'), ...entry]
background: [`${srcPath}extension/background/`, ...entry],
window: [`${srcPath}window/`, ...entry],
popup: [`${srcPath}extension/popup/`, ...entry],
inject: [`${srcPath}extension/inject/`, ...entry],
app: [path.join(__dirname, '../src/app/'), ...entry]
},
output: {
path: path.join(__dirname, '../dev'),
Expand Down Expand Up @@ -49,8 +49,7 @@ const config = baseConfig({
]
]
}
}],
entry
}]
});

config.devtool = 'eval';
Expand Down
2 changes: 1 addition & 1 deletion webpack/electron.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import baseConfig from './base.config';

export default baseConfig({
input: {
app: [path.join(__dirname, '../src/web/index')]
app: [path.join(__dirname, '../src/app/')]
},
output: {
path: path.join(__dirname, '../build/electron')
Expand Down
20 changes: 20 additions & 0 deletions webpack/extension.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import path from 'path';
import baseConfig from './base.config';
const srcPath = path.join(__dirname, '../src/browser/');

export default baseConfig({
input: {
background: [`${srcPath}extension/background/`],
window: [`${srcPath}window/`],
popup: [`${srcPath}extension/popup/`],
inject: [`${srcPath}extension/inject/`]
},
output: {
path: path.join(__dirname, '../build/extension')
},
globals: {
'process.env': {
NODE_ENV: '"production"'
}
}
});
13 changes: 0 additions & 13 deletions webpack/prod.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion webpack/web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import baseConfig from './base.config';

export default baseConfig({
input: {
app: [path.join(__dirname, '../src/web/index')]
app: [path.join(__dirname, '../src/app/')]
},
output: {
path: path.join(__dirname, '../build/web')
Expand Down

0 comments on commit 150ae3d

Please sign in to comment.