Last active
June 13, 2017 17:52
-
-
Save dphurley/0c364873dbea347d0ae610807a177f48 to your computer and use it in GitHub Desktop.
Angular on Rails / Webpack
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
npm install --save webpack | |
npm install --save glob | |
npm install --save babel-core babel-loader babel-preset-env babel-preset-es2015 | |
npm install --save html-loader | |
npm install --save angular |
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" ] } |
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
require('webpack'); | |
var glob = require('glob'); | |
module.exports = { | |
context: __dirname, | |
entry: { | |
app: glob.sync(__dirname + '/client/**/*.js') | |
}, | |
output: { | |
path: __dirname + '/app/assets/javascripts', | |
filename: '[name].bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
loader: 'babel-loader' | |
}, | |
{ | |
test: /\.html$/, | |
loader: 'html-loader' | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment