Skip to content

Instantly share code, notes, and snippets.

@muryoimpl
Created July 9, 2015 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muryoimpl/86d4c1e1481dc50aa8a1 to your computer and use it in GitHub Desktop.
Save muryoimpl/86d4c1e1481dc50aa8a1 to your computer and use it in GitHub Desktop.
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