If you write in the project
webpack.config.js
plugins: [bannerPlugin,
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
]
The size of the jsBundle file generated by such packaging is 50% smaller, but the problem is that the app cannot load such a jsBundle file. Is there any relevant solution?
The compressed jsBundle cannot be loaded because you need to add a banner that weex can recognize
If you use Vue for development, you need to keep { "framework": "Vue" }
// code compression plug-in
The code is as follows
If you use
Vue
for development, you need to keep{ "framework": "Vue" }
from being compressed, just like what was said above.