Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 404abbb

Browse files
PeterStaevsis0k0
authored andcommitted
feat: add setting for plain modules regex (#582)
Adds a registerModules option for the bundle-config-loader that allows users to specify custom regex to register their modules. Also if needed they can set the new option to false completely disabling automatic module registration for non-angular apps. Closes #556
1 parent e349fa8 commit 404abbb

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

‎bundle-config-loader.js‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
module.exports = function(source) {
1+
module.exports = function(source) {
22
this.cacheable();
3-
const { angular = false, loadCss = true } = this.query;
3+
const { angular = false, loadCss = true, registerModules =/(root|page)\.(xml|css|js|ts|scss)$/ } = this.query;
44

55
source = `
66
require("tns-core-modules/bundle-entry-points");
77
${source}
88
`;
99

10-
if (!angular) {
10+
if (!angular&&registerModules) {
1111
source = `
12-
require("nativescript-dev-webpack/register-modules");
12+
const context = require.context("~/", true, ${registerModules});
13+
global.registerWebpackModules(context);
1314
${source}
1415
`;
1516
}

‎register-modules.js‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /