Skip to content

Commit 8905654

Browse files
authored
fix: ignore unit test files in core projects (#54)
1 parent ca0cee3 commit 8905654

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

nativescript.webpack.js

+15
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ module.exports = webpack => {
2525
webpack.chainWebpack((config, env) => {
2626
if (env.unitTesting) {
2727
return setupUnitTestBuild(config, env, webpack);
28+
} else {
29+
config
30+
.plugin("IgnorePlugin|unit_tests")
31+
.use(IgnorePlugin, [{
32+
checkResource: (resource, context) => {
33+
if (context === webpack.Utils.platform.getEntryDirPath()) {
34+
if (/(^\.\/test|\.spec)\.(ts|js)$/.test(resource)) {
35+
// console.log('ignoring unit test', context, resource);
36+
return true;
37+
}
38+
}
39+
return false;
40+
41+
}
42+
}]);
2843
}
2944
});
3045
};

0 commit comments

Comments
 (0)