Last active
January 10, 2020 16:11
-
-
Save caalberts/3aa2db79756bc4886519ce620901306d to your computer and use it in GitHub Desktop.
React + Webpack + Rails
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
Show hidden characters
{ | |
"presets": ["es2015", "react"] | |
} |
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
// This is a manifest file that'll be compiled into application.js, which will include all the files | |
// listed below. | |
// | |
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | |
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. | |
// | |
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | |
// compiled file. | |
// | |
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details | |
// about supported directives. | |
// | |
//= require jquery | |
//= require jquery_ujs | |
//= require_tree . |
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
<div id="react"></div> |
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
{ | |
"dependencies": { | |
"babel-core": "^6.10.4", | |
"babel-loader": "^6.2.4", | |
"babel-preset-es2015": "^6.9.0", | |
"babel-preset-react": "^6.11.1", | |
"events": "^1.1.1", | |
"flux": "^2.1.1", | |
"react": "^15.2.1", | |
"react-dom": "^15.2.1", | |
"react-router": "^2.6.0", | |
"webpack": "^1.13.1" | |
} | |
} |
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
module.exports = { | |
entry: "./app/assets/react/main.jsx", | |
output: { | |
path: __dirname + "/app/assets/javascripts", | |
filename: "bundle.js" | |
}, | |
resolve: { | |
extensions: ['', '.js', '.jsx'] | |
}, | |
module: { | |
loaders: [ | |
{ test: /\.jsx$/, loader: 'babel-loader' } | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment