Created
July 9, 2015 02:16
-
-
Save muryoimpl/86d4c1e1481dc50aa8a1 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 assetsPath = path.join(__dirname, 'app', 'assets', 'client'); | |
module.exports = { | |
// the base path which will be used to resolve entry points | |
context: __dirname, | |
// the main entry point for our application's frontend js | |
entry: { | |
main: [ | |
'webpack/hot/only-dev-server', | |
path.join(assetsPath, 'main.cjsx') | |
] | |
}, | |
output: { | |
path: path.join(__dirname, 'app', 'assets', 'javascripts'), // for Rails Assets Pipeline | |
filename: "[name]-bundle.js" | |
}, | |
resolveLoader: { | |
modulesDirectories: ['node_modules'] | |
}, | |
resolve: { | |
extensions: ['', '.js', '.jsx', 'cjsx', '.coffee'] | |
}, | |
module: { | |
loaders: [ | |
{test: /\.jsx$/, loaders: ['jsx-loader', 'react-hot']}, | |
{test: /\.coffee$/, loaders: ['coffee']}, | |
{test: /\.cjsx$/, loaders: ['coffee', 'cjsx']}, | |
] | |
}, | |
// require the webpack and react-hot-loader plugins | |
plugins: [ | |
new webpack.HotModuleReplacementPlugin(), | |
new webpack.NoErrorsPlugin() | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment