Skip to content

Instantly share code, notes, and snippets.

@joshcrews
Created January 12, 2016 19:47
Show Gist options
  • Save joshcrews/340b9d65c3fd378ae7a0 to your computer and use it in GitHub Desktop.
Save joshcrews/340b9d65c3fd378ae7a0 to your computer and use it in GitHub Desktop.
webpack.config.js
module.exports = {
devtool: "source-map",
entry: {
"app": ["./javascripts/react-reader/index.js"],
},
output: {
path: "./javascripts",
filename: "reactreader.js"
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel",
query: {
presets: ['es2015', 'react']
}
}
]
}
}
@joshcrews
Copy link
Author

this sits in app/assets of a rails app, with a package.json and node_modules folder in the same place. all my react app files are in app/assets/javascripts/react-reader. they output that file reactreader.js, which I manually webpack -p to deploy right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment