Title: Can't resolve '~/app' for `cssFile` · Issue #587 · NativeScript/nativescript-dev-webpack · GitHub
Open Graph Title: Can't resolve '~/app' for `cssFile` · Issue #587 · NativeScript/nativescript-dev-webpack
X Title: Can't resolve '~/app' for `cssFile` · Issue #587 · NativeScript/nativescript-dev-webpack
Description: Empty new project : tns create aaa --ng : We wanted to apply different GLOBAL CSS file according to some logic. ( css which includes different font names for different languages etc...) So we did a small test just to check if applying a ...
Open Graph Description: Empty new project : tns create aaa --ng : We wanted to apply different GLOBAL CSS file according to some logic. ( css which includes different font names for different languages etc...) So we did a...
X Description: Empty new project : tns create aaa --ng : We wanted to apply different GLOBAL CSS file according to some logic. ( css which includes different font names for different languages etc...) So we did a...
Opengraph URL: https://github.com/NativeScript/nativescript-dev-webpack/issues/587
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can't resolve '~/app' for `cssFile` ","articleBody":"Empty new project : `tns create aaa --ng` : \r\n\r\nWe wanted to apply _different_ GLOBAL CSS file according to some logic. ( _css which includes different font names for different languages etc..._)\r\n\r\nSo we did a small test just to check if applying a custom name ( not `app.css` but `app1.css`) is working : \r\n\r\nWe've used the sample project : `tns create aaa --ng` & webpack (all latest versions )\r\n\r\n\r\n //main.ts:\r\n platformNativeScriptDynamic({\r\n startPageActionBarHidden: false ,\r\n cssFile:\"app1.css\"\r\n }) .bootstrapModule(AppModule);\r\n\r\n\r\n\r\n\r\nIt **DOES** work (without `--bundle`).\r\n\r\n\r\n\r\n\r\n\r\nSo you can see that Items are red : \r\n\r\n \r\n\r\n\r\n\r\n\r\n**BUT** - Now we wanted to test with `--bundle` ,[ so we've modified the webpack json file also to search for `app1.css` and not `app.css`](https://gist.github.com/RoyiNamir/134ecdd9a28a01aa2bbfe2348c81a939#file-webpack-config-js-L163-L179)\r\n\r\n\r\n(also modified `main.aot.ts`) with : \r\n\r\n import { setCssFileName } from \"application\";\r\n setCssFileName(\"./app1.css\");\r\n\r\nHowever - running `tns run android --bundle` does NOT work : \r\n\r\n\r\n\r\n```\r\nERROR in ../node_modules/nativescript-dev-webpack/load-application-css-angular.js\r\nModule not found: Error: Can't resolve '~/app' in 'C:\\Users\\sff\\Desktop\\delme1\\ddd\\node_modules\\nativescript-dev-webpack'\r\n @ ../node_modules/nativescript-dev-webpack/load-application-css-angular.js 5:49-65\r\n @ ./main.ts\r\n```\r\n\r\nI've also tried with : \r\n\r\n import { setCssFileName } from \"application\";\r\n setCssFileName(\"./app1.css\");\r\n\r\nIt run to completion but the `app1.css` file is not applied ( no reds here) : \r\n\r\n\r\n\r\n\r\nWe've tried many variations :\r\n```\r\n cssFile:\"app1.css\"\r\n cssFile:\"./app1.css\"\r\n cssFile:\"~/app1.css\"\r\n cssFile:\"/app1.css\"\r\n```\r\n\r\nBut when I think about it , this ^ is not related - becuase if I do `cssFile:\"app1.css\"` **without** `--bundle` then - `app1.css` is respected.\r\nthe problem is that it's not respected with `--bundle`\r\n\r\n\r\nNone of them worked.\r\n\r\n\r\n\r\nIt seems that `app1.css` with `--bundle` is not respected. Only `app.css` is respected.\r\n\r\n\r\n\r\n-------\r\n\r\n[package.json ](https://gist.github.com/411a3b7bae8d5f6a325b1797868ee379) \r\nproject sample : https://ufile.io/ge4to\r\n\r\nnativescript@4.1.1 \r\nWindows 10","author":{"url":"https://github.com/mid787","@type":"Person","name":"mid787"},"datePublished":"2018-06-26T08:25:30Z","url":"https://github.com/NativeScript/nativescript-dev-webpack/issues/587"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d59365e4-1a04-8b7d-0281-4d21bc26dce9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BCF6:2AAD2E:1B6AFAD:248EB95:6B016135 |
| html-safe-nonce | cc82f369dec586f2f189a863a3988b9e1300a3567debb0b98c6d4da186cc8bf2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0Y2OjJBQUQyRToxQjZBRkFEOjI0OEVCOTU6NkIwMTYxMzUiLCJ2aXNpdG9yX2lkIjoiMTM2NjExNzg0MTgyMDAxNjk0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b0c194cac4ac0c5a8ddeaaaf2e5436239e7b999643380be0e341152d56489b29 |
| hovercard-subject-tag | issue:335710327 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/nativescript-dev-webpack/587/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0bb75f858cb667f9058626e95064715ea873085b97b489a5cf7400f57a66b452/NativeScript/nativescript-dev-webpack/issues/587 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0bb75f858cb667f9058626e95064715ea873085b97b489a5cf7400f57a66b452/NativeScript/nativescript-dev-webpack/issues/587 |
| og:image:alt | Empty new project : tns create aaa --ng : We wanted to apply different GLOBAL CSS file according to some logic. ( css which includes different font names for different languages etc...) So we did a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mid787 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/nativescript-dev-webpack git https://github.com/NativeScript/nativescript-dev-webpack.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 54984270 |
| octolytics-dimension-repository_nwo | NativeScript/nativescript-dev-webpack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 54984270 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/nativescript-dev-webpack |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width