T249658 posed the question of whether or not we should pre-compile the Vue.JS search app in the Vector skin. Although that initial conversation favoured precompiling, subsequent conversations have revealed that **not compiling** Vue.js is the more socially acceptable and perhaps technically simpler approach.
However, in order to use the WVUI library directly in ResourceLoader, without a build-step in Vector, changes need to be made to the WVUI webpack export:
- In [[ https://gerrit.wikimedia.org/r/plugins/gitiles/wvui/+/refs/heads/master/.webpack/config.js#95 | .wepack/config.js ]] WVUI must export a bundle formatted as `commonjs2`, which appears to be the format most compatible with ResourceLoader’s CommonJS implementation.
- The WVUI component exports (e.g. in [[ https://gerrit.wikimedia.org/r/plugins/gitiles/wvui/+/refs/heads/master/src/components/button/Button.vue#16 | Button.vue ]]) must export a plain object, as opposed to one wrapped in `Vue.extend()` as they do currently. //This was probably done for type-checking reasons, but not 100% sure, seems to work fine either way//. Removing the Vue.js invocations from the components also removes the Vue.js runtime from the bundled output, allowing us to use the version of Vue.js bundled in MediaWiki.
These changes will allow us to use WVUI in ResourceLoader in the following way:
In `skin.json`
```
"wvui": {
"PackageFiles": "resources/wvui/wvui.commonjs2.js",
"dependencies": [ "vue" ]
}
```
And then the actual usage of the library in Vector:
```
var wvui = require("wvui");
// -> {components: { Button: {} ...
```
We can still keep the default UMD formatted export as the default WVUI export, and make the CommonJS version an additional bundle.