Assets 文件夹不包含 NativeScript Android Build 中的 HTML 文件

Eri*_*ngs 1 android nativescript angular2-nativescript nativescript-telerik-ui nativescript-angular

我正在尝试显示一个本地 html 文件,其中包含引用的 JS 和 CSS 以及 PNG 图像。我将这些文件放入适用于 Android 的 NativeScript x Angular 应用程序的资产文件夹中。当我运行 tns run android --bundle 并构建应用程序时 - 资产文件夹不包含 html。文件夹结构从 assets > index.html (和 index.html 引用其他文件)。

是否有某个地方或方式我需要包含 html 文件,以便它们包含在构建中?

Man*_*noj 6

您必须CopyWebpackPlugin在您的更新中webpack.config.js包含资产文件夹

// Copy assets to out dir. Add your own globs as needed.
new CopyWebpackPlugin([
 { from: "fonts/**" },
 { from: "**/*.jpg" },
 { from: "**/*.png" },
 { from: "assets/**" }, // Add your asset folder path like this
], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
Run Code Online (Sandbox Code Playgroud)