NativeScript / NativeScript/nativescript-cli
[android] packaged aar should be by modules appearing after webpack compilation
@KristianDD 已經在處理了。
開始於 2019年2月27日。
- 主要語言
- JavaScript
- 星號
- 1.1k
- 分支
- 204
- 平均合併
- 1 天 9 小時
- 30 天內合併 PR
- 8
描述
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
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
評估
這個 Issue 還沒有評估資料。