mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix: app-css-loader to look for platform specific app s?css files too
This commit is contained in:
@@ -4,13 +4,16 @@ import { dedent } from 'ts-dedent';
|
||||
* This loader tries to load an `app.scss` or and `app.css` relative to the main entry
|
||||
*/
|
||||
export default function loader(content: string, map: any) {
|
||||
const { platform } = this.getOptions();
|
||||
const callback = this.async();
|
||||
const resolve = this.getResolve({
|
||||
extensions: ['.scss', '.css'],
|
||||
extensions: [`.${platform}.scss`, `.${platform}.css`, '.scss', '.css'],
|
||||
});
|
||||
|
||||
resolve(this.context, './app', (err, res) => {
|
||||
if (err || !res) {
|
||||
// if we ran into an error or there's no css file found, we just return
|
||||
// original content and not append any additional imports.
|
||||
return callback(null, content, map);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user