2016-03-17 22:15:54 +00:00
|
|
|
/*
|
|
|
|
Copyright 2015 Gravitational, Inc.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
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 21:41:02 +00:00
|
|
|
styles: ['./src/styles/bootstrap/bootstrap.scss', './src/styles/inspinia/style.scss', './src/styles/grv.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-22 17:21:18 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
test: /\.svg$/,
|
|
|
|
loader: 'svg-sprite'
|
|
|
|
},
|
|
|
|
|
|
|
|
{ test: /\.(woff|woff2|ttf|eot)$/, 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
|
|
|
}),
|
|
|
|
|
2016-03-22 19:29:35 +00:00
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
2016-03-16 06:28:59 +00:00
|
|
|
compress: { warnings: false }
|
2016-03-22 19:29:35 +00:00
|
|
|
})
|
2016-02-22 23:36:40 +00:00
|
|
|
]
|
|
|
|
};
|