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

Commit 5f5686b

Browse files
committed
fix(template): disable minification of css by css-loader
When uglify is used, it triggers the minification option of the css-loader. The css-loader uses internally cssnano to optimize the size of the stylesheets. Since NativeScript supports only a subset of the CSS language, many of these optimizations may be damaging for the user's css. Such is the case with `background-position`: center, which gets translated to `background-position`: 50%, which is currently not working in NativeScript 3.0 (NativeScript/NativeScript#4201). closes #135
1 parent 3181821 commit 5f5686b

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

Diff for: prepublish/common/rules.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ module.exports = `
1313
loader: "resolve-url-loader",
1414
options: { silent: true },
1515
},
16-
"nativescript-css-loader",
16+
{
17+
loader: "nativescript-css-loader",
18+
options: { minimize: false }
19+
},
1720
"nativescript-dev-webpack/platform-css-loader",
1821
]),
1922
},

Diff for: templates/webpack.angular.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ function getRules() {
8585
loader: "resolve-url-loader",
8686
options: { silent: true },
8787
},
88-
"nativescript-css-loader",
88+
{
89+
loader: "nativescript-css-loader",
90+
options: { minimize: false }
91+
},
8992
"nativescript-dev-webpack/platform-css-loader",
9093
]),
9194
},

Diff for: templates/webpack.javascript.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ function getRules() {
8484
loader: "resolve-url-loader",
8585
options: { silent: true },
8686
},
87-
"nativescript-css-loader",
87+
{
88+
loader: "nativescript-css-loader",
89+
options: { minimize: false }
90+
},
8891
"nativescript-dev-webpack/platform-css-loader",
8992
]),
9093
},

Diff for: templates/webpack.typescript.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ function getRules() {
8484
loader: "resolve-url-loader",
8585
options: { silent: true },
8686
},
87-
"nativescript-css-loader",
87+
{
88+
loader: "nativescript-css-loader",
89+
options: { minimize: false }
90+
},
8891
"nativescript-dev-webpack/platform-css-loader",
8992
]),
9093
},

0 commit comments

Comments
 (0)