sweetalert2 / sweetalert2-themes

Themes for SweetAlert2: Dark, Minimal, Borderless, Bootstrap, Material UI, WordPress Admin, Bulma, ...
MIT License
221 stars 92 forks source link

SassError because of node_modules/ #81

Closed MiDniGG closed 2 years ago

MiDniGG commented 2 years ago

Current behavior

I'm using sweetalert in a Symfony Bundle and use the scss from the bundle in the customer app.

With https://github.com/sweetalert2/sweetalert2-themes/pull/80 my scss file isn't working anymore.

I import the main scss like that

@import "../../vendor/my-bundle/assets/css/main";

The problem ist now, when I run yarn build in the customer app, that it says

SassError: Can't find stylesheet to import.
  â•·
3 │ @import 'node_modules/sweetalert2/src/variables';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  ../rks-pis-bundle/node_modules/@sweetalert2/theme-bootstrap-4/bootstrap-4.scss 3:9  @import
  vendor/rks/pis-bundle/assets/css/plugins/_sweetalert2.scss 18:9                     @import

because in the customer app, there is no sweetalert2 in node_modules, only in the Bundle.

Expected behavior

No SassError. 😅

Live demo

The recommondation from Webpack says to replace ~ with nothing, this would work fine for me. So please consider to change

@import 'node_modules/sweetalert2/src/variables';

to

@import 'sweetalert2/src/variables';
limonte commented 2 years ago

Thank you @MiDniGG for reporting and sorry about the troubles!

limonte commented 2 years ago

:tada: This issue has been resolved in version 5.0.7 :tada:

The release is available on:

Your semantic-release bot :package::rocket: