This repository has been archived by the owner on Aug 7, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow extending webpack.config.js through env
In case you need to extend the webpack.config.js, currently you cannot extend everything and you need to write a lot of custom logic. This PR adds the possibility to extend the appComponents, entries and alias through `env`. Also update demo applications to use latest CLI feature for extending webpack.config.js
- Loading branch information
1 parent
e95287d
commit 69ace1e
Showing
17 changed files
with
122 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
{ | ||
"android": { | ||
"v8Flags": "--expose_gc" | ||
"v8Flags": "--expose_gc", | ||
"markingMode": "none" | ||
}, | ||
"main": "main.js", | ||
"name": "tns-template-hello-world-ng", | ||
"version": "3.3.0" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
demo/AngularApp/custom-application-activity.webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const webpackConfig = require("./webpack.config"); | ||
const path = require("path"); | ||
|
||
module.exports = env => { | ||
env = env || {}; | ||
env.appComponents = env.appComponents || []; | ||
env.appComponents.push(path.resolve(__dirname, "app/activity.android.ts")); | ||
|
||
env.entries = env.entries || {}; | ||
env.entries.application = "./application.android"; | ||
const config = webpackConfig(env); | ||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"webpackConfigPath": "custom-application-activity.webpack.config.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
{ | ||
"android": { | ||
"v8Flags": "--expose_gc" | ||
"v8Flags": "--expose_gc", | ||
"markingMode": "none" | ||
}, | ||
"main": "app.js", | ||
"name": "tns-template-hello-world", | ||
"version": "3.3.0" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
demo/JavaScriptApp/custom-application-activity.webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const webpackConfig = require("./webpack.config"); | ||
const path = require("path"); | ||
|
||
module.exports = env => { | ||
env = env || {}; | ||
env.appComponents = env.appComponents || []; | ||
env.appComponents.push(path.resolve(__dirname, "app/activity.android.js")); | ||
|
||
env.entries = env.entries || {}; | ||
env.entries.application = "./application.android"; | ||
const config = webpackConfig(env); | ||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"webpackConfigPath": "./custom-application-activity.webpack.config.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
{ | ||
"android": { | ||
"v8Flags": "--expose_gc" | ||
"v8Flags": "--expose_gc", | ||
"markingMode": "none" | ||
}, | ||
"main": "app.js", | ||
"name": "tns-template-hello-world-ts", | ||
"version": "3.3.0" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
demo/TypeScriptApp/custom-application-activity.webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const webpackConfig = require("./webpack.config"); | ||
const path = require("path"); | ||
|
||
module.exports = env => { | ||
env = env || {}; | ||
env.appComponents = env.appComponents || []; | ||
env.appComponents.push(path.resolve(__dirname, "app/activity.android.ts")); | ||
|
||
env.entries = env.entries || {}; | ||
env.entries.application = "./application.android"; | ||
const config = webpackConfig(env); | ||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"useLegacyWorkflow": false | ||
"webpackConfigPath": "./custom-application-activity.webpack.config.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.