$ is not defined within a .js.erb view using Webpack 2 in Rails app
问题 I'm migrating from assets pipeline to Webpack 2 in a Rails 4 app. Everything seems to work fine, except for the JS code using jQuery within a .js.erb view. The content of the webpack.config.js is as follows (omitted code for fingerprinting and compression): const path = require('path') const webpack = require('webpack') const ExtractTextPlugin = require('extract-text-webpack-plugin') const jsOutputTemplate = 'javascripts/[name].js' const cssOutputTemplate = 'stylesheets/[name].css' module