These are chat archives for ractivejs/ractive

11th
Dec 2018
kouts
@kouts
Dec 11 2018 15:15
I have an issue with Ractive modal when trying to use it with import in a project of mine.
Up until now I was using it as a global var and Ractive was also a global var.
At first I thought that because I hadn't imported Ractive inside the component that was the case.
So I fixed that in the dev branch and tried again but import ractive_modal from 'ractive-modal';
gives me ERROR in ../node_modules/ractive-modal/dist/ractive-modal.js Module not found: Error: Can't resolve 'Ractive' in '....../node_modules/ractive-modal/dist'
I also upgraded to Webpack 4 in the dev branch but still the same issue, I'm sure it's something trivial I'm missing
Chris Reeves
@evs-chris
Dec 11 2018 17:37
I vaguely remember webpack having an issue with ractive as a module if you didn't set it up in a certain way.
Any particular reason you want ractive bundled? Cause if not, you get a pretty significant benefit from using it as a global from a standalone script.
kouts
@kouts
Dec 11 2018 18:53
I think I JUST found it
it was a mistake in the externals setting in webpack config, was using Ractive instead of ractive
I usually don't bundle Ractive but in this specific app (being "enterprise" and all that) there must be no globals whatsoever or if they are they must be contained in a specific namespace...
a "vendor" namespace for example
kouts
@kouts
Dec 11 2018 18:59
thanks for your help @evs-chris !
Chris Reeves
@evs-chris
Dec 11 2018 19:05
oof, no globals...
I'm glad you found it! webpack configs aren't fun to troubleshoot at all
rollup is a pleasant breeze comparatively, if you don't need the handful of extras that webpack offers
kouts
@kouts
Dec 11 2018 19:09
indeed, the issue was on the ractive-modal webpack setup though which is pretty basic, it was one of those dumb mistakes you are looking all over the place and it's finally under your nose :smile:
The application's webpack config though, you dont want to know!
I tried rollup at some point but I couldn't get it to play well with some jQuery plugins and other stuff I don't remember right now
and in that point of time Webpack 4 came out so...
kouts
@kouts
Dec 11 2018 19:16
Anyway, I think Ractive version 1 release went pretty much ok, no major bugs or anything, so good work!