Closed MWDelaney closed 6 years ago
I had the exact same problem! The quick solution that i found so far, to make it at least work was (i have a React SPA) i added to my html file script with this code - https://raw.githubusercontent.com/electerious/basicScroll/master/dist/basicScroll.min.js - and in my components assigned a variable like const basicScroll = window.basicScroll
. That worked for me. Try it yourself.
Are you using uglify or uglify-es? It might be a bug with the newest version (uglify-es) as re-minifying works with fine for me with uglify.
It would be great if someone could open an issue on the tool causing the issues.
I've opened an issue in the uglify-es
repository as uglifyjs-webpack-plugin
relies on uglify-es
: https://github.com/mishoo/UglifyJS2/issues/3109
@MWDelaney @aaronwaldon Recompressing basicScroll.min.js with uglify-es
works fine, too. Can you please show us how you're using and importing basicScroll?
I believe the issue was caused by using the webpack.optimize.UglifyJsPlugin in Webpack 3. I have since migrated to Webpack 4 and switched to the TerserPlugin, and everything seems to be working as expected. Thank you for the help and guidance!
Good to hear :) I will close the issue as I have no clue what's causing it. Will reopen when necessary.
Hi, I'm trying to include basicScroll in a Roots/Sage project and I'm getting a console error after building my assets for production.
I'm not the most webpack savvy user, so my troubleshooting is limited. The library works great when the assets aren't uglified, but throw the above error in the browser console when the webpack bundle is uglified.
I've tried separating basicScroll into its own separate script file (still uglified) with the same result. I've also tried a fresh copy of Sage with no other (non-default) dependencies, also with the same result.
I'm happy to try any more troubleshooting steps you can suggest. Thank you for your time and for this awesome library.