NativeScript / NativeScript/nativescript-cli

[android] packaged aar should be by modules appearing after webpack compilation

Abierto
#4,400 2 comentarios 0 reacciones 1 asignado Ver en GitHub

@KristianDD ya está trabajando en esto.

Desde el 27/2/2019.

feature plugins
Lenguaje dominante
JavaScript
Estrellas
1.1k
Forks
204
Merge medio
1 d 9 h
PR fusionados (30 d)
8

Descripción

I now use webpack-strip-block in my app to remove code in production.
The idea behind this is to be able to use nativescript-vue-devtools in dev but obviously remove it in production.
So i add this to my webpack

if (!!production) {
        config.module.rules.push({
            test: /\.tsx?$/,
            enforce: 'pre',
            exclude: /node_modules/,
            use: [
                {
                    loader: 'webpack-strip-block',
                    options: {
                        start: 'DEV-START',
                        end: 'DEV-END'
                    }
                }
            ]
        });
    }

and in my app i do something like this:

/* DEV-START */
console.log('only shown in dev', device.model, device.os, device.osVersion, device.manufacturer);
const VueDevtools = require('nativescript-vue-devtools');
Vue.use(VueDevtools);
/* DEV-END */

This works perfectly and the code is removed in prod. So nativescript-dev-tools is not packd in prod.
But remains the issue of the native version of the modules. nativescript-dev-tools depends on nativescript-socket-io which has native lib.
My issue is that nativescript-socket-io native lib will always be packed with my app even if ``nativescript-dev-toolsis stripped and thennativescript-socket-io``` not packaged.

The list of native module to be added by filtering used packages after webpack compilation (not sure how that list is created right now). It should not be based on the package.json

Hope that issue makes sense

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.