mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
b638ae186d
* API client utility * moves test helpers to the test directory * Utility to namespace local storage keys * LoginSuccessfulPage component * Check icon * adds auth to redux state * successful form submission * Allow tests to load dummy SVG static images & test fixes
77 lines
1.9 KiB
JavaScript
77 lines
1.9 KiB
JavaScript
require('es6-promise').polyfill();
|
|
|
|
var path = require('path');
|
|
var webpack = require('webpack');
|
|
var autoprefixer = require('autoprefixer');
|
|
var ExtractTextPlugin = require("extract-text-webpack-plugin");
|
|
|
|
var plugins = [
|
|
new webpack.NoErrorsPlugin(),
|
|
new webpack.optimize.DedupePlugin(),
|
|
];
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
plugins = plugins.concat([
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
output: {comments: false},
|
|
test: /bundle\.js?$/
|
|
}),
|
|
new webpack.DefinePlugin({
|
|
'process.env': {NODE_ENV: JSON.stringify('production')}
|
|
})
|
|
]);
|
|
};
|
|
|
|
var repo = __dirname
|
|
|
|
var config = {
|
|
entry: {
|
|
bundle: path.join(repo, 'frontend/index.jsx')
|
|
},
|
|
output: {
|
|
path: path.join(repo, 'assets/'),
|
|
publicPath: "/assets/",
|
|
filename: '[name].js'
|
|
},
|
|
plugins: plugins,
|
|
module: {
|
|
loaders: [
|
|
{test: /\.(png|gif)$/, loader: 'url-loader?name=[name]@[hash].[ext]&limit=6000'},
|
|
{test: /\.(pdf|ico|jpg|svg|eot|otf|woff|ttf|mp4|webm)$/, loader: 'file-loader?name=[name]@[hash].[ext]'},
|
|
{test: /\.json$/, loader: 'json-loader'},
|
|
{
|
|
test: /\.jsx?$/,
|
|
include: path.join(repo, 'frontend'),
|
|
loaders: ['babel']
|
|
}
|
|
]
|
|
},
|
|
resolve: {
|
|
extensions: ['', '.js', '.jsx'],
|
|
alias: {
|
|
'#app': path.join(repo, 'frontend'),
|
|
'#components': path.join(repo, 'frontend/components'),
|
|
}
|
|
},
|
|
svgo1: {
|
|
multipass: true,
|
|
plugins: [
|
|
// by default enabled
|
|
{mergePaths: false},
|
|
{convertTransform: false},
|
|
{convertShapeToPath: false},
|
|
{cleanupIDs: false},
|
|
{collapseGroups: false},
|
|
{transformsWithOnePath: false},
|
|
{cleanupNumericValues: false},
|
|
{convertPathData: false},
|
|
{moveGroupAttrsToElems: false},
|
|
// by default disabled
|
|
{removeTitle: true},
|
|
{removeDesc: true}
|
|
]
|
|
}
|
|
};
|
|
|
|
module.exports = config;
|