Skip to content

Commit c1a2d54

Browse files
authored
fix(webpack): apply-css-loader not applying css (NativeScript#8811)
* fix(webpack): apply-css-loader not applying css * chore: bump webpack version to rc * fix: import style scope
1 parent 6a8a0d5 commit c1a2d54

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/webpack/helpers/apply-css-loader.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ module.exports = function (content, map) {
2626
}
2727

2828
content += `
29-
const nsCore = require("@nativescript/core");
29+
const { Application } = require("@nativescript/core");
3030
require("@nativescript/core/ui/styling/style-scope");
3131
32-
if (typeof exports.forEach === "function") {
33-
exports.forEach(cssExport => {
32+
if (___CSS_LOADER_EXPORT___ && typeof ___CSS_LOADER_EXPORT___.forEach === "function") {
33+
___CSS_LOADER_EXPORT___.forEach(cssExport => {
3434
if (cssExport.length > 1 && cssExport[1]) {
3535
// applying the second item of the export as it contains the css contents
36-
nsCore.Application.addCss(cssExport[1]);
36+
Application.addCss(cssExport[1]);
3737
}
3838
});
3939
}

0 commit comments

Comments
 (0)