Wruczek / Bootstrap-Cookie-Alert

A simple, good looking cookie alert built for Bootstrap 3/4. No dependencies required.
https://wruczek.github.io/Bootstrap-Cookie-Alert/demo-bs5.html
MIT License
237 stars 51 forks source link

Using with Webpack (Encore) #16

Closed Schyzophrenic closed 4 years ago

Schyzophrenic commented 4 years ago

I have used the static version of this little script for a while, thank you for that. I am trying to move to Webpack (Encore) but facing some challenges. In my main app.js, I include: import cookieAlert from 'bootstrap-cookie-alert'; and in the scss: @import "~bootstrap-cookie-alert"; (could be done in the app.js though)

The build fails as the script cannot find the required sources:

SassError: File to import not found or unreadable: ~bootstrap-cookie-alert.
...
>> @import "~bootstrap-cookie-alert";

The js inclusion would also fail with:

 ERROR  Failed to compile with 1 errors                                                                         12:20:53
This dependency was not found:

* bootstrap-cookie-alert in ./assets/js/app.js

To install it, you can run: npm install --save bootstrap-cookie-alert

This issue should be resolved with #17