Created
November 27, 2015 13:18
-
-
Save phaistonian/dabee53dc3aa608fb69c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Webpack = require('webpack'); | |
var path = require('path'); | |
var entry = require('./webpack-entry'); | |
// Prepend local dev server | |
for (var i in entry) { | |
entry[i] = ['webpack-dev-server/client?http://local.bestprice.gr:3000', 'webpack/hot/dev-server'] | |
.concat(entry[i]); | |
} | |
var config = { | |
devtool: 'eval', | |
debug: false, | |
entry: entry, | |
output: { | |
path: path.resolve(__dirname, 'build'), | |
filename: '[name].js', | |
publicPath: 'http://local.bestprice.gr:3000/build/' // This HAS to point to the build path in order for hot reload to work | |
}, | |
module: { | |
loaders: [{ | |
test: /\.js$/, | |
loaders: ['react-hot', 'babel?stage=0'], | |
include: [ | |
path.join(__dirname, 'js'), | |
path.join(__dirname, 'views') | |
] | |
}, { | |
test: /\.css$/, | |
loader: 'style-loader!css-loader!autoprefixer-loader', | |
include: [ | |
path.join(__dirname, 'css'), | |
path.join(__dirname, 'views'), | |
path.join(__dirname, 'js') | |
] | |
}, { | |
test: /\.styl$/, | |
loader: 'style-loader!css-loader!autoprefixer-loader!stylus-loader?{"resolve url":1}', | |
include: [ | |
path.join(__dirname, 'css'), | |
path.join(__dirname, 'views'), | |
path.join(__dirname, 'js') | |
] | |
} | |
, { | |
test: /.*\.(gif|png|jpe?g|svg)$/i, | |
loaders: [ | |
'file?hash=sha512&name=images/[hash:6].[ext]' | |
] | |
}] | |
}, | |
resolve: { | |
alias: { | |
css: path.join(__dirname, 'css'), | |
js: path.join(__dirname, 'js'), | |
components: path.join(__dirname, 'js', 'components'), | |
core: path.join(__dirname, 'js', 'core'), | |
apps: path.join(__dirname, 'js', 'apps'), | |
hoc: path.join(__dirname, 'js', 'hoc'), | |
modules: path.join(__dirname, 'js', 'modules') | |
}, | |
extensions: ['', '.js', '.json', '.css', 'styl'], | |
root: './node_modules/' | |
}, | |
plugins: [ | |
new Webpack.HotModuleReplacementPlugin(), | |
new Webpack.NoErrorsPlugin() | |
] | |
}; | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment