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

Commit 516885d

Browse files
authored
Merge pull request #1056 from NativeScript/fatme/tests-files
fix: exclude files from tests folder from built application
2 parents 6aaeedf + c61f10e commit 516885d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: bundle-config-loader.spec.ts

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ const defaultTestFiles = {
3939
"./_app-variables.scss": false, // do not include scss partial files
4040
"./App_Resources/Android/src/main/res/values/colors.xml": false, // do not include App_Resources
4141
"./App_Resources/Android/src/main/AndroidManifest.xml": false, // do not include App_Resources
42+
"./tests/example.js": false, // do not include files from tests folder
43+
"./tests/component1/model1/file1.js": false, // do not include files from tests folder
44+
"./components/tests/example.js": true,
4245
};
4346

4447
const loaderOptionsWithIgnore = {

Diff for: bundle-config-loader.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { loader } from "webpack";
33
import { getOptions } from "loader-utils";
44
import * as escapeRegExp from "escape-string-regexp";
55

6-
// Matches all source, markup and style files that are not in App_Resources
7-
const defaultMatch = "(?<!\\bApp_Resources\\b.*)\\.(xml|css|js|(?<!\\.d\\.)ts|(?<!\\b_[\\w-]*\\.)scss)$";
6+
// Matches all source, markup and style files that are not in App_Resources and in tests folder
7+
const defaultMatch = "(?<!\\bApp_Resources\\b.*)(?<!\\.\\/\\btests\\b\\/.*?)\\.(xml|css|js|(?<!\\.d\\.)ts|(?<!\\b_[\\w-]*\\.)scss)$";
88

99
const loader: loader.Loader = function (source, map) {
1010
let {

0 commit comments

Comments
 (0)