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

Commit 3305ee4

Browse files
author
vakrilov
committed
refactor: handle only app.css with css2json for Vue
1 parent 632af4f commit 3305ee4

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

templates/webpack.vue.js

+25-2
Original file line numberDiff line numberDiff line change
@@ -195,20 +195,43 @@ module.exports = env => {
195195
},
196196
].filter(loader => Boolean(loader)),
197197
},
198+
{
199+
test: /[\/|\\]app\.css$/,
200+
use: [
201+
'nativescript-dev-webpack/style-hot-loader',
202+
{
203+
loader: "nativescript-dev-webpack/css2json-loader",
204+
options: { useForImports: true }
205+
},
206+
],
207+
},
208+
{
209+
test: /[\/|\\]app\.scss$/,
210+
use: [
211+
'nativescript-dev-webpack/style-hot-loader',
212+
{
213+
loader: "nativescript-dev-webpack/css2json-loader",
214+
options: { useForImports: true }
215+
},
216+
'sass-loader',
217+
],
218+
},
198219
{
199220
test: /\.css$/,
221+
exclude: /[\/|\\]app\.css$/,
200222
use: [
201223
'nativescript-dev-webpack/style-hot-loader',
202224
'nativescript-dev-webpack/apply-css-loader.js',
203-
'nativescript-dev-webpack/css2json-loader',
225+
{ loader: "css-loader", options: { url: false } },
204226
],
205227
},
206228
{
207229
test: /\.scss$/,
230+
exclude: /[\/|\\]app\.scss$/,
208231
use: [
209232
'nativescript-dev-webpack/style-hot-loader',
210233
'nativescript-dev-webpack/apply-css-loader.js',
211-
'nativescript-dev-webpack/css2json-loader',
234+
{ loader: "css-loader", options: { url: false } },
212235
'sass-loader',
213236
],
214237
},

0 commit comments

Comments
 (0)