Skip to content

Commit 0a07b33

Browse files
committed
Removed scss files from complied sources
1 parent 0619ec6 commit 0a07b33

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

lib/after-prepare.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
var fs = require('fs');
2+
var path = require('path');
3+
var glob = require('glob');
4+
var Promise = require('bluebird');
5+
6+
module.exports = function ($logger, $projectData, $usbLiveSyncService) {
7+
// delete all scss files from compiled sources
8+
var platformsData = $injector.resolve('platformsData');
9+
return Promise.each(platformsData.platformsNames, function (platform) {
10+
var sassFilesPath = path.join(platformsData.getPlatformData(platform).appDestinationDirectoryPath, 'app/**/*.scss');
11+
var sassFiles = glob.sync(sassFilesPath).filter(function (filePath) {
12+
var path = filePath;
13+
var parts = path.split('/');
14+
var filename = parts[parts.length - 1];
15+
return path.indexOf("App_Resources") === -1 && filename.indexOf("_") !== 0;
16+
});
17+
return Promise.each(sassFiles, function (sassFile) {
18+
return fs.unlinkSync(sassFile);
19+
});
20+
});
21+
}

package.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-dev-sass",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "SASS CSS pre-processor for NativeScript projects.",
55
"scripts": {
66
"test": "exit 0",
@@ -13,6 +13,11 @@
1313
"type": "before-prepare",
1414
"script": "lib/before-prepare.js",
1515
"inject": true
16+
},
17+
{
18+
"type": "after-prepare",
19+
"script": "lib/after-prepare.js",
20+
"inject": true
1621
}
1722
]
1823
},
@@ -22,6 +27,7 @@
2227
"url": "https://github.com/ToddAnglin/nativescript-dev-sass.git"
2328
},
2429
"dependencies": {
30+
"bluebird": "^3.4.6",
2531
"node-sass": "*",
2632
"glob": "*",
2733
"nativescript-hook": "^0.2.0"

0 commit comments

Comments
 (0)