Skip to content

Instantly share code, notes, and snippets.

@srimajji
Last active December 20, 2016 05:10
Show Gist options
  • Save srimajji/aa67629e78ac832d1d0b3526b98a3516 to your computer and use it in GitHub Desktop.
Save srimajji/aa67629e78ac832d1d0b3526b98a3516 to your computer and use it in GitHub Desktop.
Webpack config using webpack-dev-middle feathersjs and react-toolbox
var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'inline-source-map',
entry: [
'babel-polyfill',
// 'webpack/hot/dev-server',
// 'webpack-hot-middleware/client',
'./client/index.js'
],
output: {
path: path.join(__dirname, './public/dist'),
filename: 'bundle.js',
publicPath: '/dist/'
},
plugins: [
// new webpack.optimize.OccurenceOrderPlugin(),
// new webpack.HotModuleReplacementPlugin(),
new webpack.ProvidePlugin({
'window.jQuery': 'jquery'
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('development'),
'API_URL': JSON.stringify('http://localhost:3030/api/')
}
}),
new webpack.NoErrorsPlugin()
],
resolve: {
alias: {
'react': path.resolve(__dirname, 'node_modules', 'react'),
'react-toolbox': path.resolve(__dirname, 'node_modules', 'react-toolbox')
},
extensions: ['', '.js', '.jsx', '.scss', '.css'],
modulesDirectories: ['node_modules'],
},
module: {
loaders: [
{
test: /\.jsx?$/,
loaders: ['babel'],
exclude: path.join(__dirname, '../node_modules/'),
include: path.join(__dirname, '/client/')
},
{
test: /(\.css|\.scss)$/,
loaders: ['style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', 'sass?sourceMap'],
include: [path.resolve(__dirname, 'node_modules/react-toolbox'), path.resolve(__dirname, 'client')]
},
{
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000',
include: path.join(__dirname, '/client/')
},
{
test: /\.json$/,
loader: 'json'
}
]
}
};
stats: {
assets: true,
colors: true,
version: false,
hash: false,
timings: true,
chunks: false,
chunkModules: false
},
noInfo: false,
quiet: false,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment