mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(cuteness): allow cleartext HTTP for API 28 (#7397)
* chore(cuteness): update configuration files * fix(cuteness): allow cleartext HTTP for API 28
This commit is contained in:
@@ -19,7 +19,8 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@drawable/icon"
|
android:icon="@drawable/icon"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme"
|
||||||
|
android:usesCleartextTraffic="true">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.tns.NativeScriptActivity"
|
android:name="com.tns.NativeScriptActivity"
|
||||||
|
|||||||
@@ -13,13 +13,12 @@
|
|||||||
"license": "SEE LICENSE IN <your-license-filename>",
|
"license": "SEE LICENSE IN <your-license-filename>",
|
||||||
"repository": "<fill-your-repository-here>",
|
"repository": "<fill-your-repository-here>",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nativescript-theme-core": "~1.0.4",
|
|
||||||
"tns-core-modules": "next"
|
"tns-core-modules": "next"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"nativescript-dev-typescript": "next",
|
|
||||||
"nativescript-dev-webpack": "next",
|
"nativescript-dev-webpack": "next",
|
||||||
"tns-platform-declarations": "next"
|
"tns-platform-declarations": "next",
|
||||||
|
"typescript": "3.4.1"
|
||||||
},
|
},
|
||||||
"gitHead": "8c1a4866a66daab09bf5ef8e5a96472687192373",
|
"gitHead": "8c1a4866a66daab09bf5ef8e5a96472687192373",
|
||||||
"readme": "NativeScript Application"
|
"readme": "NativeScript Application"
|
||||||
|
|||||||
@@ -39,12 +39,14 @@ module.exports = env => {
|
|||||||
|
|
||||||
// You can provide the following flags when running 'tns run android|ios'
|
// You can provide the following flags when running 'tns run android|ios'
|
||||||
snapshot, // --env.snapshot
|
snapshot, // --env.snapshot
|
||||||
|
production, // --env.production
|
||||||
uglify, // --env.uglify
|
uglify, // --env.uglify
|
||||||
report, // --env.report
|
report, // --env.report
|
||||||
sourceMap, // --env.sourceMap
|
sourceMap, // --env.sourceMap
|
||||||
hiddenSourceMap, // --env.hiddenSourceMap
|
hiddenSourceMap, // --env.hiddenSourceMap
|
||||||
hmr, // --env.hmr,
|
hmr, // --env.hmr,
|
||||||
unitTesting, // --env.unitTesting
|
unitTesting, // --env.unitTesting,
|
||||||
|
verbose, // --env.verbose
|
||||||
} = env;
|
} = env;
|
||||||
const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
|
const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
|
||||||
const externals = nsWebpack.getConvertedExternals(env.externals);
|
const externals = nsWebpack.getConvertedExternals(env.externals);
|
||||||
@@ -58,14 +60,21 @@ module.exports = env => {
|
|||||||
|
|
||||||
const tsConfigPath = resolve(projectRoot, "tsconfig.tns.json");
|
const tsConfigPath = resolve(projectRoot, "tsconfig.tns.json");
|
||||||
|
|
||||||
if (platform === "ios") {
|
const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some(e => e.indexOf("tns-core-modules") > -1);
|
||||||
entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules.js";
|
if (platform === "ios" && !areCoreModulesExternal) {
|
||||||
|
entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules";
|
||||||
};
|
};
|
||||||
|
|
||||||
let sourceMapFilename = nsWebpack.getSourceMapFilename(hiddenSourceMap, __dirname, dist);
|
let sourceMapFilename = nsWebpack.getSourceMapFilename(hiddenSourceMap, __dirname, dist);
|
||||||
|
|
||||||
|
const itemsToClean = [`${dist}/**/*`];
|
||||||
|
if (platform === "android") {
|
||||||
|
itemsToClean.push(`${join(projectRoot, "platforms", "android", "app", "src", "main", "assets", "snapshots")}`);
|
||||||
|
itemsToClean.push(`${join(projectRoot, "platforms", "android", "app", "build", "configurations", "nativescript-android-snapshot")}`);
|
||||||
|
}
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
mode: uglify ? "production" : "development",
|
mode: production ? "production" : "development",
|
||||||
context: appFullPath,
|
context: appFullPath,
|
||||||
externals,
|
externals,
|
||||||
watchOptions: {
|
watchOptions: {
|
||||||
@@ -231,25 +240,14 @@ module.exports = env => {
|
|||||||
"process": undefined,
|
"process": undefined,
|
||||||
}),
|
}),
|
||||||
// Remove all files from the out dir.
|
// Remove all files from the out dir.
|
||||||
new CleanWebpackPlugin([`${dist}/**/*`]),
|
new CleanWebpackPlugin(itemsToClean, { verbose: !!verbose }),
|
||||||
// Copy assets to out dir. Add your own globs as needed.
|
// Copy assets to out dir. Add your own globs as needed.
|
||||||
new CopyWebpackPlugin([
|
new CopyWebpackPlugin([
|
||||||
{ from: { glob: "fonts/**" } },
|
{ from: { glob: "fonts/**" } },
|
||||||
{ from: { glob: "res/**" } },
|
|
||||||
{ from: { glob: "**/*.jpg" } },
|
{ from: { glob: "**/*.jpg" } },
|
||||||
{ from: { glob: "**/*.png" } },
|
{ from: { glob: "**/*.png" } },
|
||||||
], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
|
], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
|
||||||
// Generate a bundle starter script and activate it in package.json
|
new nsWebpack.GenerateNativeScriptEntryPointsPlugin("bundle"),
|
||||||
new nsWebpack.GenerateBundleStarterPlugin(
|
|
||||||
// Don't include `runtime.js` when creating a snapshot. The plugin
|
|
||||||
// configures the WebPack runtime to be generated inside the snapshot
|
|
||||||
// module and no `runtime.js` module exist.
|
|
||||||
(snapshot ? [] : ["./runtime"])
|
|
||||||
.concat([
|
|
||||||
"./vendor",
|
|
||||||
"./bundle",
|
|
||||||
])
|
|
||||||
),
|
|
||||||
// For instructions on how to set up workers with webpack
|
// For instructions on how to set up workers with webpack
|
||||||
// check out https://github.com/nativescript/worker-loader
|
// check out https://github.com/nativescript/worker-loader
|
||||||
new NativeScriptWorkerPlugin(),
|
new NativeScriptWorkerPlugin(),
|
||||||
@@ -270,18 +268,6 @@ module.exports = env => {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
// Copy the native app resources to the out dir
|
|
||||||
// only if doing a full build (tns run/build) and not previewing (tns preview)
|
|
||||||
if (!externals || externals.length === 0) {
|
|
||||||
config.plugins.push(new CopyWebpackPlugin([
|
|
||||||
{
|
|
||||||
from: `${appResourcesFullPath}/${appResourcesPlatformDir}`,
|
|
||||||
to: `${dist}/App_Resources/${appResourcesPlatformDir}`,
|
|
||||||
context: projectRoot
|
|
||||||
},
|
|
||||||
]));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (report) {
|
if (report) {
|
||||||
// Generate report files for bundles content
|
// Generate report files for bundles content
|
||||||
config.plugins.push(new BundleAnalyzerPlugin({
|
config.plugins.push(new BundleAnalyzerPlugin({
|
||||||
|
|||||||
Reference in New Issue
Block a user