-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48260b3
commit 06c97d2
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const path = require('path'); | ||
|
||
const srcPath = path.join(process.cwd(), '/src'); | ||
|
||
module.exports = { | ||
resolve: { | ||
fallback: srcPath | ||
}, | ||
module: { | ||
loaders: [{ | ||
loader: 'babel', | ||
test: /\.js$/, | ||
include: srcPath, | ||
exclude: /(node_modules|bower_components|static_components)/, | ||
query: { | ||
presets: [ | ||
'react', | ||
'es2015', | ||
'stage-1' | ||
] | ||
} | ||
}] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const webpack = require('webpack'); | ||
const webpackBase = require('./webpack.base.js'); | ||
const log = require(process.cwd() + '/src/server/log'); | ||
|
||
log.app.env(); | ||
|
||
const dev = process.env.NODE_ENV !== 'production'; | ||
const plugins = [ | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify( | ||
dev ? 'development' : 'production' | ||
) | ||
}) | ||
]; | ||
|
||
if (!dev) { | ||
plugins.push( | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compress: { warnings: false } | ||
}) | ||
); | ||
} | ||
|
||
module.exports = Object.assign({}, webpackBase, { | ||
entry: { | ||
'core': './src/client/core/index.js', | ||
'home': './src/client/home/index.js', | ||
'app': './src/client/app/index.js', | ||
'login': './src/client/login/index.js', | ||
'register': './src/client/register/index.js', | ||
}, | ||
output: { | ||
path: './public/js/', | ||
filename: '[name].js' | ||
}, | ||
devtool: dev ? 'inline-source-map' : undefined, | ||
plugins | ||
}); |