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

Commit 3fe8c9e

Browse files
committed
fix: update the css loader in order to fix a bug with leading dashes of css classes
1 parent dc6210d commit 3fe8c9e

File tree

8 files changed

+105
-105
lines changed

8 files changed

+105
-105
lines changed

Diff for: demo/AngularApp/webpack.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ module.exports = env => {
198198
test: /[\/|\\]app\.css$/,
199199
use: [
200200
"nativescript-dev-webpack/style-hot-loader",
201-
{ loader: "css-loader", options: { minimize: false, url: false } }
201+
{ loader: "css-loader", options: { url: false } }
202202
]
203203
},
204204
{
205205
test: /[\/|\\]app\.scss$/,
206206
use: [
207207
"nativescript-dev-webpack/style-hot-loader",
208-
{ loader: "css-loader", options: { minimize: false, url: false } },
208+
{ loader: "css-loader", options: { url: false } },
209209
"sass-loader"
210210
]
211211
},

Diff for: demo/JavaScriptApp/webpack.config.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ module.exports = env => {
102102
"__dirname": false,
103103
},
104104
devtool: sourceMap ? "inline-source-map" : "none",
105-
optimization: {
105+
optimization: {
106106
splitChunks: {
107107
cacheGroups: {
108108
vendor: {
@@ -111,7 +111,7 @@ module.exports = env => {
111111
test: (module, chunks) => {
112112
const moduleName = module.nameForCondition ? module.nameForCondition() : '';
113113
return /[\\/]node_modules[\\/]/.test(moduleName) ||
114-
appComponents.some(comp => comp === moduleName);
114+
appComponents.some(comp => comp === moduleName);
115115

116116
},
117117
enforce: true,
@@ -172,17 +172,17 @@ module.exports = env => {
172172
use: "nativescript-dev-webpack/markup-hot-loader"
173173
},
174174

175-
{ test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader"},
175+
{ test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader" },
176176

177177
{
178178
test: /\.css$/,
179-
use: { loader: "css-loader", options: { minimize: false, url: false } }
179+
use: { loader: "css-loader", options: { url: false } }
180180
},
181181

182182
{
183183
test: /\.scss$/,
184184
use: [
185-
{ loader: "css-loader", options: { minimize: false, url: false } },
185+
{ loader: "css-loader", options: { url: false } },
186186
"sass-loader"
187187
]
188188
},
@@ -195,14 +195,14 @@ module.exports = env => {
195195
"process": undefined,
196196
}),
197197
// Remove all files from the out dir.
198-
new CleanWebpackPlugin([ `${dist}/**/*` ]),
199-
// Copy native app resources to out dir.
198+
new CleanWebpackPlugin([`${dist}/**/*`]),
199+
// Copy native app resources to out dir.
200200
new CopyWebpackPlugin([
201-
{
202-
from: `${appResourcesFullPath}/${appResourcesPlatformDir}`,
203-
to: `${dist}/App_Resources/${appResourcesPlatformDir}`,
204-
context: projectRoot
205-
},
201+
{
202+
from: `${appResourcesFullPath}/${appResourcesPlatformDir}`,
203+
to: `${dist}/App_Resources/${appResourcesPlatformDir}`,
204+
context: projectRoot
205+
},
206206
]),
207207
// Copy assets to out dir. Add your own globs as needed.
208208
new CopyWebpackPlugin([

Diff for: demo/TypeScriptApp/webpack.config.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ module.exports = env => {
104104
"__dirname": false,
105105
},
106106
devtool: sourceMap ? "inline-source-map" : "none",
107-
optimization: {
107+
optimization: {
108108
splitChunks: {
109109
cacheGroups: {
110110
vendor: {
@@ -113,7 +113,7 @@ module.exports = env => {
113113
test: (module, chunks) => {
114114
const moduleName = module.nameForCondition ? module.nameForCondition() : '';
115115
return /[\\/]node_modules[\\/]/.test(moduleName) ||
116-
appComponents.some(comp => comp === moduleName);
116+
appComponents.some(comp => comp === moduleName);
117117

118118
},
119119
enforce: true,
@@ -174,17 +174,17 @@ module.exports = env => {
174174
use: "nativescript-dev-webpack/markup-hot-loader"
175175
},
176176

177-
{ test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader"},
177+
{ test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader" },
178178

179179
{
180180
test: /\.css$/,
181-
use: { loader: "css-loader", options: { minimize: false, url: false } }
181+
use: { loader: "css-loader", options: { url: false } }
182182
},
183183

184184
{
185185
test: /\.scss$/,
186186
use: [
187-
{ loader: "css-loader", options: { minimize: false, url: false } },
187+
{ loader: "css-loader", options: { url: false } },
188188
"sass-loader"
189189
]
190190
},
@@ -209,14 +209,14 @@ module.exports = env => {
209209
"process": undefined,
210210
}),
211211
// Remove all files from the out dir.
212-
new CleanWebpackPlugin([ `${dist}/**/*` ]),
212+
new CleanWebpackPlugin([`${dist}/**/*`]),
213213
// Copy native app resources to out dir.
214214
new CopyWebpackPlugin([
215-
{
216-
from: `${appResourcesFullPath}/${appResourcesPlatformDir}`,
217-
to: `${dist}/App_Resources/${appResourcesPlatformDir}`,
218-
context: projectRoot
219-
},
215+
{
216+
from: `${appResourcesFullPath}/${appResourcesPlatformDir}`,
217+
to: `${dist}/App_Resources/${appResourcesPlatformDir}`,
218+
context: projectRoot
219+
},
220220
]),
221221
// Copy assets to out dir. Add your own globs as needed.
222222
new CopyWebpackPlugin([

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"@angular-devkit/core": "~7.2.0",
7878
"clean-webpack-plugin": "~1.0.0",
7979
"copy-webpack-plugin": "~4.6.0",
80-
"css-loader": "~1.0.0",
80+
"css-loader": "~2.1.1",
8181
"global-modules-path": "2.0.0",
8282
"minimatch": "3.0.4",
8383
"nativescript-hook": "0.2.4",

Diff for: templates/webpack.angular.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ module.exports = env => {
209209
test: /[\/|\\]app\.css$/,
210210
use: [
211211
"nativescript-dev-webpack/style-hot-loader",
212-
{ loader: "css-loader", options: { minimize: false, url: false } }
212+
{ loader: "css-loader", options: { url: false } }
213213
]
214214
},
215215
{
216216
test: /[\/|\\]app\.scss$/,
217217
use: [
218218
"nativescript-dev-webpack/style-hot-loader",
219-
{ loader: "css-loader", options: { minimize: false, url: false } },
219+
{ loader: "css-loader", options: { url: false } },
220220
"sass-loader"
221221
]
222222
},

Diff for: templates/webpack.javascript.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
88
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
99
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
1010
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
11-
const hashSalt = Date.now().toString();
11+
const hashSalt = Date.now().toString();
1212

1313
module.exports = env => {
1414
// Add your custom Activities, Services and other android app components here.
@@ -113,7 +113,7 @@ module.exports = env => {
113113
test: (module, chunks) => {
114114
const moduleName = module.nameForCondition ? module.nameForCondition() : '';
115115
return /[\\/]node_modules[\\/]/.test(moduleName) ||
116-
appComponents.some(comp => comp === moduleName);
116+
appComponents.some(comp => comp === moduleName);
117117

118118
},
119119
enforce: true,
@@ -177,17 +177,17 @@ module.exports = env => {
177177
use: "nativescript-dev-webpack/markup-hot-loader"
178178
},
179179

180-
{ test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader"},
180+
{ test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader" },
181181

182182
{
183183
test: /\.css$/,
184-
use: { loader: "css-loader", options: { minimize: false, url: false } }
184+
use: { loader: "css-loader", options: { url: false } }
185185
},
186186

187187
{
188188
test: /\.scss$/,
189189
use: [
190-
{ loader: "css-loader", options: { minimize: false, url: false } },
190+
{ loader: "css-loader", options: { url: false } },
191191
"sass-loader"
192192
]
193193
},
@@ -200,7 +200,7 @@ module.exports = env => {
200200
"process": undefined,
201201
}),
202202
// Remove all files from the out dir.
203-
new CleanWebpackPlugin([ `${dist}/**/*` ]),
203+
new CleanWebpackPlugin([`${dist}/**/*`]),
204204
// Copy assets to out dir. Add your own globs as needed.
205205
new CopyWebpackPlugin([
206206
{ from: { glob: "fonts/**" } },
@@ -213,10 +213,10 @@ module.exports = env => {
213213
// configures the WebPack runtime to be generated inside the snapshot
214214
// module and no `runtime.js` module exist.
215215
(snapshot ? [] : ["./runtime"])
216-
.concat([
217-
"./vendor",
218-
"./bundle",
219-
])
216+
.concat([
217+
"./vendor",
218+
"./bundle",
219+
])
220220
),
221221
// For instructions on how to set up workers with webpack
222222
// check out https://github.com/nativescript/worker-loader

Diff for: templates/webpack.typescript.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
88
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
99
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
1010
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
11-
const hashSalt = Date.now().toString();
11+
const hashSalt = Date.now().toString();
1212

1313
module.exports = env => {
1414
// Add your custom Activities, Services and other Android app components here.
@@ -115,7 +115,7 @@ module.exports = env => {
115115
test: (module, chunks) => {
116116
const moduleName = module.nameForCondition ? module.nameForCondition() : '';
117117
return /[\\/]node_modules[\\/]/.test(moduleName) ||
118-
appComponents.some(comp => comp === moduleName);
118+
appComponents.some(comp => comp === moduleName);
119119

120120
},
121121
enforce: true,
@@ -179,17 +179,17 @@ module.exports = env => {
179179
use: "nativescript-dev-webpack/markup-hot-loader"
180180
},
181181

182-
{ test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader"},
182+
{ test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader" },
183183

184184
{
185185
test: /\.css$/,
186-
use: { loader: "css-loader", options: { minimize: false, url: false } }
186+
use: { loader: "css-loader", options: { url: false } }
187187
},
188188

189189
{
190190
test: /\.scss$/,
191191
use: [
192-
{ loader: "css-loader", options: { minimize: false, url: false } },
192+
{ loader: "css-loader", options: { url: false } },
193193
"sass-loader"
194194
]
195195
},
@@ -213,7 +213,7 @@ module.exports = env => {
213213
"process": undefined,
214214
}),
215215
// Remove all files from the out dir.
216-
new CleanWebpackPlugin([ `${dist}/**/*` ]),
216+
new CleanWebpackPlugin([`${dist}/**/*`]),
217217
// Copy assets to out dir. Add your own globs as needed.
218218
new CopyWebpackPlugin([
219219
{ from: { glob: "fonts/**" } },
@@ -226,10 +226,10 @@ module.exports = env => {
226226
// configures the WebPack runtime to be generated inside the snapshot
227227
// module and no `runtime.js` module exist.
228228
(snapshot ? [] : ["./runtime"])
229-
.concat([
230-
"./vendor",
231-
"./bundle",
232-
])
229+
.concat([
230+
"./vendor",
231+
"./bundle",
232+
])
233233
),
234234
// For instructions on how to set up workers with webpack
235235
// check out https://github.com/nativescript/worker-loader

0 commit comments

Comments
 (0)