NativeScript/nativescript-dev-sass

app.{platform}.scss not renamed to app.css

Dutchboy opened this issue · 5 comments

Hi @toddanglin !

I'm using nativescript-theme-core and webpack with nativescript-dev-sass ......

My problem is that when doing a bundle, the app.android.scss does get compiled to app.android.css, but it doesn't get renamed to app.css

ERROR in Entry module not found: Error: Can't resolve './app.css' in 'C:\00.Dev\nativescriptApp\app'
ERROR in [copy-webpack-plugin] unable to locate 'app.css' at 'C:\00.Dev\nativescriptApp\app\app.css'

Can you hint me where it tries to rename the compiled app.android.css or app.ios.css into the app.css?

Thanks so much for your effort!!!!! Lars

Hmm...

That step (changing [filename].[platform].css to [filename].css) is handled by the NativeScript build process. It SHOULD be applied to all files in the project (images, views, styles, etc). That said, I've not done a lot of work with webpack, so I'm not sure how that affects the process.

@rdlauer @tjvantoll Do you have any ideas here? Have you tried using WebPack with the Core Theme + SASS?

I have not. This surprises me a little because as far as I know this SASS plugin works a whole lot like the TypeScript plugin, and I haven’t had any trouble with TypeScript code not getting compiled before Webpack does its thing.

@sis0k0 Any idea what the problem might be here?

@Dutchboy So...if you take a look at the "demo" project that's included with this repo, and you should see that there is an example that covers this scenario. The demo app has both a app.ios.scss and a app.android.scss.

Based on my local tests with iOS, these files correctly get converted to CSS and then deployed to the app package as app.css.

Now that said, there is no app.css in my app directory, EVEN AFTER the SASS conversion happens. NativeScript takes the correct app.ios.css or app.android.css at build time and renames it to app.css. And just to be sure, I checked and LiveSync works as expected, too.

I'm not using WebPack, though, so I assume the problem has to do with that workflow. Can you try taking the demo app in this repo and seeing if you can re-create the error? That will help me better understand what's happening when you're using WebPack...

Hasn't been any follow-up on this in a while. Going to close as it seems to be working as expected in the demo app. Please feel free to add additional detail if this needs to be re-opened.

Having the same issue