-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swiper v6 CSS not generated with Webpack in PROD builds #3673
Comments
After further investigation I can now confirm the reason is |
swiper/build/bundle/package.json Line 8 in 77d72e4
|
I also encountered this problem |
Side effects is a must as it highly improves tree shaking. It is related to webpack webpack/webpack#6571 For example, create-react-app has this in loaders:
|
Since the post you've mentioned is open for over two years it's unlikely that it'll be solved soo. So, what should Swiper users do when they have a Webpack project, which for me, is like industry standard for non-libraries? Would it be possible to specify these CSS files to have side-effects, like: webpack/webpack#6571 (comment) |
|
I don't know why this has been closed but here is the solution: @nolimits4web change following to the package.json with the next update:
so stylesheet has sideEffects or for @julmot
Important here is sideEffects: true |
This is a (multiple allowed):
bug
enhancement
feature-discussion (RFC)
Swiper Version: v6.0.1
Platform/Target and Browser Versions: Windows 10
What you did
I've upgraded from v5.4.5 to v6.0.1.
Expected Behavior
I changed the imports from
to
and expected it to work, since I have none of the breaking changes implemented, mentioned in the CHANGELOG.
Actual Behavior
The CSS contents is missing in my webpack build since the upgrade, without changed webpack configuration. For example this is missing:
For compiling SASS/SCSS/CSS my Webpack configuration looks like:
Since the change is quite huge it's nearly impossible for me to find the related thing to this. However, what I could imagin is that since the entire bundle architecture was refactored, this may be related to Webpack's tree shaking algorithm or the
sideEffects
property in package.json.What could be the issue here?
Maybe related to #3671
The text was updated successfully, but these errors were encountered: