I'm getting Uncaught TypeError: $(...).tablesorter is not a function
after migrating to Rails 6 with Webpack. Here is my environment.js
const { environment } = require('@rails/webpacker')
const webpack = require('webpack')
environment.plugins.prepend('Provide',
new webpack.ProvidePlugin({
$: 'jquery/src/jquery',
jQuery: 'jquery/src/jquery',
tablesorter: 'tablesorter',
bootstrap: 'bootstrap/dist/js/bootstrap',
draggable: 'plain-draggable'
})
)
module.exports = environment
The other plugins associated are working correctly.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…