Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

--bundle ruins css #378

Closed
laimonas opened this issue Dec 22, 2017 · 14 comments · Fixed by #385
Closed

--bundle ruins css #378

laimonas opened this issue Dec 22, 2017 · 14 comments · Fixed by #385
Assignees

Comments

@laimonas
Copy link

laimonas commented Dec 22, 2017

Created new project --ng with angular 5.
Added npm install --save-dev nativescript-dev-webpack
running tns run android everything is ok
running tns run android --bundle listview has no styles.

@berchik
Copy link

berchik commented Dec 23, 2017

This is probably because
@import '~nativescript-theme-core/css/core.light.css' (or similar) in your app.css is not bundled with webpack. I have the same issue.

@laimonas
Copy link
Author

@berchik do you found solution how to solve this?

@berchik
Copy link

berchik commented Dec 23, 2017

One way would of course be to copy manually the android/ios css files from /node_modules/nativescript-theme-core/css/ to your app/css, but this is quite dirty. I’m trying to look into webpack.config.js but no success yet.

@milansar
Copy link

Have same problem as mentioned by @berchik , after upgrading and following upgrade document changed @import 'nativescript-theme-core/css/core.light.css' to @import '~nativescript-theme-core/css/core.light.css' in app.css. after bundling app all styles defined in theme core does not apply so it appears that theme core is not copied as it use to be

@NickIliev
Copy link
Contributor

@berchik @laimonas @milansar confirming this as a bug reproducible only when bundling on Windows.

Steps to reproduce:

  • use this demo application
  • CLI build with tns run android applies the nativescript themefromapp.css` as expected
  • Bundling with Webpack is not applying the theme styles

Reproducible only on Windows - everything works as expected on Mac (@berchik @laimonas @milansar can you confirm that you are building in Windows environment)

@laimonas
Copy link
Author

@NickIliev yes i'm using windows 10.

@berchik
Copy link

berchik commented Dec 26, 2017

@NickIliev yes the issue is on win10.
Moving it to OSX the style is applied correctly, but the app is frozen, not sure yet why.
So I can't comment on using --env.aot/snapshot/uglify for now.

@milansar
Copy link

@NickIliev yes i'm using windows 10

@behi1ty
Copy link

behi1ty commented Dec 27, 2017

i'm using windows 10 and not set app.css :"@import '~nativescript-theme-core/css/core.light.css';" after use "tns run android --bundle" but use "tns run android" that is ok!

@AmithRamesh
Copy link

AmithRamesh commented Dec 28, 2017

I am facing the same issue on Mac os X as well. The theme core styles are not being applied with 'tns run android --bundle'. Not tried ios build with webpack yet. But 'tns run android' works fine.

Update: I guess entire app.css isn't applied with --bundle

@sis0k0
Copy link
Contributor

sis0k0 commented Dec 29, 2017

Hey, everyone. You can apply that fix b1d3bcb manually in your webpack configurations until #385 is merged and released.

@berchik
Copy link

berchik commented Dec 29, 2017

Thanks Stanimira,

For win10 I can confirm “~” is resolved correctly as the path relative to node_modules.
However “~/” is not resolved correctly, but using “./” in app.css instead is ok.

--env.uglify is working too
--env.aot fails

@AmithRamesh
Copy link

Thank you for the fix @sis0k0 .

On mac, the app.css was not bundled because vendor.js wasn't updated, it was fixed after running "./node_modules/.bin/update-ns-webpack --configs --deps" from this guide.

Now as @berchik mentioned, only --env.aot is failing.

@AmithRamesh
Copy link

Referring #386 for --env.aot issue. It works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants