Skip to content

Instantly share code, notes, and snippets.

@dphurley
Last active June 13, 2017 17:52
Show Gist options
  • Save dphurley/0c364873dbea347d0ae610807a177f48 to your computer and use it in GitHub Desktop.
Save dphurley/0c364873dbea347d0ae610807a177f48 to your computer and use it in GitHub Desktop.
Angular on Rails / Webpack
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
{ "presets": [ "es2015" ] }
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