Skip to content

Instantly share code, notes, and snippets.

@IstoraMandiri
Created May 26, 2016 16:19
Show Gist options
  • Save IstoraMandiri/300b184f56dfd60ff2281bfa6c72fdd3 to your computer and use it in GitHub Desktop.
Save IstoraMandiri/300b184f56dfd60ff2281bfa6c72fdd3 to your computer and use it in GitHub Desktop.
Not working with `npm link`
var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'eval',
entry: [
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
}),
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [
{
test: /\.css$/,
loader: "style-loader!css-loader"
},
{
test: /\.(png|woff|woff2|eot|ttf|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url'
},
{
test: /\.js$/,
loaders: ['babel'],
include: path.join(__dirname, 'src'),
presets: [
"react",
"es2015",
"stage-2"
].map(require.resolve)
}
]
},
// for modules
resolve: {
fallback: [path.join(__dirname, 'node_modules')]
},
// same issue, for loaders like babel
resolveLoader: {
fallback: [path.join(__dirname, 'node_modules')]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment