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

android packaging with assets #1136

Open
1 task
cybaj opened this issue May 5, 2020 · 0 comments
Open
1 task

android packaging with assets #1136

cybaj opened this issue May 5, 2020 · 0 comments

Comments

@cybaj
Copy link

cybaj commented May 5, 2020

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.5.0

  • Cross-platform modules: 6.5.1

  • Android Runtime: 6.5.0

  • iOS Runtime: 6.5.0

  • Plugin(s): nativescript-webview-interface

  • Node.js: v12.16.1

  • Please, attach your package.json and webpack.config.js as these configurations are usually critical for investigating issues with webpack

Describe the bug

There are different results between preview and build android.
on preview it just works fine.
but packaging doesn't include some assets.

this is app directory,
as you can see, there are www assets.

app
├── app.css
├── App_Resources
│   ├── Android
│   │   ├── app.gradle
│   │   └── src
│   └── iOS
│       ├── Assets.xcassets
│       ├── Info.plist
│       └── LaunchScreen.storyboard
├── app.ts
├── bundle-config.ts
├── main-page.ts
├── main-page.xml
├── main-view-model.ts
├── package.json
├── page2.xml
└── www
    ├── index.html
    ├── index.js
    ├── lib
    │   ├── es6-promise.min.js
    │   └── nativescript-webview-interface.js
    └── test.js

I think bundling works just fine.

Preparing project...
Starting type checking service...
Using 1 worker with 4096MB memory limit
Hash: 5abf1bbfd6b00f297a15
Version: webpack 4.27.1
Time: 3339ms
Built at: 05/05/2020 8:12:40 PM
                                    Asset       Size   Chunks             Chunk Names
                                bundle.js    104 KiB   bundle  [emitted]  bundle
                             package.json  176 bytes           [emitted]  
                               runtime.js   13.9 KiB  runtime  [emitted]  runtime
                      tns-java-classes.js    0 bytes           [emitted]  
                                vendor.js   5.42 MiB   vendor  [emitted]  vendor
                           www/index.html  417 bytes           [emitted]  
                             www/index.js   2.01 KiB           [emitted]  
               www/lib/es6-promise.min.js   17.5 KiB           [emitted]  
www/lib/nativescript-webview-interface.js   6.17 KiB           [emitted]  
                              www/test.js  218 bytes           [emitted]  
Entrypoint bundle = runtime.js vendor.js bundle.js

with this configuration.

              new CopyWebpackPlugin([    
                  { from: { glob: "fonts/**" } },    
                  { from: { glob: "**/*.jpg" } },    
                  { from: { glob: "**/*.png" } },    
                  { from: { glob: "www/*.html" } },    
                  { from: { glob: "www/*.js" } },    
                  { from: { glob: "www/lib/*.js" } },      
              ], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),    

but app-debug.pkg include only assets/app/www/file,
not assets/app/www/lib/*.js.

assets/app/bundle.js
assets/app/package.json
assets/app/runtime.js
assets/app/tns-java-classes.js
assets/app/vendor.js
assets/app/www/index.html
assets/app/www/index.js
assets/app/www/test.js

I think there are some process on packaging, but I don't know how can I found this.
I only assume that maybe there are some configuration with nativescript-dev-webpack,
but I can't find it.

To Reproduce

tns build android

Expected behavior
packaging with assets which have some directory hierarchy.

Sample project

repos

Additional context

I build with nativescript-remote-builds.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant