fleet/webpack.config.js
Mike Stone 01e7ac2b6c Create query (#382)
* API call to create queries

* Add queries to redux

* create query when query form is submitted

* Redirect to ShowQueryPage after creating query

* Removes theme dropdown and NewQuery component header

* Extract NewQueryPage component state to redux state

* Pass logic down to NewQuery component as props

* Changes NewQuery component name to QueryComposer

* Render NewQueryPage for /queries/:id route

* Update ReduxConfig for loading a single resource

* QueryPage tests

* Get query when the query page loads

* catch errors when query is invalid

* Renames UpdateQueryForm to QueryForm to re-usability

* Changes InputField to a controlled component

* Always render the Query Form on Query Pages
2016-11-07 11:42:39 -05:00

105 lines
2.8 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 bourbon = require('node-bourbon').includePaths;
var WebpackBuildNotifierPlugin = require('webpack-build-notifier');
var plugins = [
new webpack.NoErrorsPlugin(),
new webpack.optimize.DedupePlugin(),
new ExtractTextPlugin("bundle.css", {allChunks: false})
];
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')}
})
]);
};
if (process.argv.indexOf('--notify') > -1) {
plugins = plugins.concat([
new WebpackBuildNotifierPlugin({
title: "Kolide",
logo: path.resolve("./assets/images/kolide-logo.svg"),
suppressWarning: true,
suppressSuccess: true,
sound: false
})
])
};
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: 'raw-loader'},
{test: /\.tsx?$/, exclude: /node_modules/, loader: 'ts-loader'},
{
test: /\.scss$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract('style-loader', 'css!sass?sourceMap=true&includePaths[]=' + bourbon + '!import-glob')
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!autoprefixer-loader')
},
{
test: /\.jsx?$/,
include: path.join(repo, 'frontend'),
loaders: ['babel']
}
]
},
resolve: {
extensions: ['', '.js', '.jsx', '.json'],
alias: {
'#app': path.join(repo, 'frontend'),
'#components': path.join(repo, 'frontend/components'),
},
root: [
path.resolve(path.join(repo, './frontend'))
]
},
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;