Created
May 26, 2016 16:19
-
-
Save IstoraMandiri/300b184f56dfd60ff2281bfa6c72fdd3 to your computer and use it in GitHub Desktop.
Not working with `npm link`
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 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