2016-02-22 23:36:40 +00:00
|
|
|
var path = require('path');
|
|
|
|
var webpack = require('webpack');
|
|
|
|
var pkgs = require('./package.json');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
|
|
|
app: ['./src/app/index.jsx'],
|
|
|
|
vendor: Object.keys(pkgs.dependencies),
|
2016-03-17 19:28:42 +00:00
|
|
|
styles: ['./src/styles/bootstrap/bootstrap.scss', './src/styles/inspinia/style.scss', './src/styles/grv-app.scss']
|
2016-02-22 23:36:40 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
output: {
|
|
|
|
publicPath: '/web/app',
|
|
|
|
path: path.join(__dirname, 'dist/app'),
|
|
|
|
filename: '[name].js',
|
|
|
|
chunkFilename: '[chunkhash].js',
|
|
|
|
sourceMapFilename: '[name].map'
|
|
|
|
},
|
|
|
|
|
2016-03-16 06:28:59 +00:00
|
|
|
externals: ['jQuery', 'Terminal', '_' ],
|
2016-02-22 23:36:40 +00:00
|
|
|
|
|
|
|
resolve: {
|
|
|
|
root: [ path.join(__dirname, 'src') ],
|
|
|
|
extensions: ['', '.js', '.jsx']
|
|
|
|
},
|
|
|
|
|
|
|
|
module: {
|
|
|
|
|
|
|
|
loaders: [
|
2016-03-16 06:28:59 +00:00
|
|
|
{ test: /\.(woff|woff2|ttf|eot|svg)$/, loader: "url-loader?limit=10000&name=fonts/[name].[ext]" },
|
2016-02-22 23:36:40 +00:00
|
|
|
{
|
|
|
|
include: path.join(__dirname, 'src'),
|
2016-03-16 06:28:59 +00:00
|
|
|
test: /\.(js|jsx)$/,
|
2016-02-22 23:36:40 +00:00
|
|
|
exclude: /node_modules/,
|
2016-03-15 18:04:36 +00:00
|
|
|
loader: 'eslint!react-hot!babel?loose=all&cacheDirectory'
|
2016-02-22 23:36:40 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
|
|
|
loader: 'style!raw!sass?outputStyle=expanded'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
2016-03-16 06:28:59 +00:00
|
|
|
new webpack.DefinePlugin({'process.env.NODE_ENV': '"production"'}),
|
2016-02-22 23:36:40 +00:00
|
|
|
new webpack.optimize.OccurenceOrderPlugin(),
|
|
|
|
new webpack.optimize.CommonsChunkPlugin({
|
|
|
|
names: ['vendor']
|
2016-03-16 06:28:59 +00:00
|
|
|
}),
|
|
|
|
|
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
|
|
compress: { warnings: false }
|
|
|
|
})
|
2016-02-22 23:36:40 +00:00
|
|
|
]
|
|
|
|
};
|