Hi all, I an trying to build from vue.js sources, see:
ITP: https://bugs.debian.org/871459
repo: https://anonscm.debian.org/git/pkg-javascript/vue.js.git

More precisely what is wanted is the browser (UMD) build, see:

To rebuild dist from source, upstream uses rollup (which is currently stuck in 
contrib) plus a few rollup plugins we lack:
- rollup-plugin-buble
- rollup-plugin-alias
- rollup-plugin-node-resolve

Therefore I attempted a hacky build avoiding rollup completely, and using a 
combination of babeljs + browserify-lite.

First I patched .babelrc as follows (apparently jsx can be used by vue apps, 
but is not required for building vue itself):
-  "plugins": ["transform-vue-jsx", "syntax-dynamic-import"],
+  "plugins": ["syntax-dynamic-import"],

apt install node-browserify-lite node-babel-cli node-babel-preset-es2015 
node-babel-plugin-syntax-dynamic-import node-babel-preset-flow-vue
babeljs src -d dist1
NODE_PATH=dist1 browserify-lite --standalone Vue ./dist1/core/index.js 
--outfile dist/vue.js
uglifyjs -o dist/vue.min.js --source-map=dist/vue.min.js.map dist/vue.js

The resulting binaries are smaller/different than upstream 

ls -l dist
-rw-r--r-- 1 root root 165464 Nov 29 10:19 vue.js
-rw-r--r-- 1 root root 111528 Nov 29 10:19 vue.min.js
-rw-r--r-- 1 root root 106896 Nov 29 10:19 vue.min.js.map

ls -l ../vue.js-2.5.9/dist
-rw-r--r-- 1 paolog paolog 286869 nov 27 22:54 vue.common.js
-rw-r--r-- 1 paolog paolog 278610 nov 27 22:54 vue.esm.browser.js
-rw-r--r-- 1 paolog paolog 286852 nov 27 22:54 vue.esm.js
-rw-r--r-- 1 paolog paolog 284067 nov 27 22:54 vue.js
-rw-r--r-- 1 paolog paolog  86676 nov 27 22:54 vue.min.js
-rw-r--r-- 1 paolog paolog 208010 nov 27 22:54 vue.runtime.common.js
-rw-r--r-- 1 paolog paolog 207993 nov 27 22:54 vue.runtime.esm.js
-rw-r--r-- 1 paolog paolog 205957 nov 27 22:54 vue.runtime.js
-rw-r--r-- 1 paolog paolog  61382 nov 27 22:54 vue.runtime.min.js

Testing them in a real-world application which works fine with upstream dist 
files gives errors in the browser console:

vue.js:1450 Uncaught ReferenceError: process is not defined
    at Object.10.shared/util (vue.js:1450)
    at req (vue.js:6)
    at modRequire (vue.js:11)
    at Object.4.../config (vue.js:273)
    at req (vue.js:6)
    at modRequire (vue.js:11)
    at Object.1../init (vue.js:54)
    at req (vue.js:6)
    at modRequire (vue.js:11)
    at Object.0../instance/index (vue.js:21)

feeds.php:123 Uncaught ReferenceError: Vue is not defined
    at feeds.php:123


Has anybody here more clues than I have ?


Pkg-javascript-devel mailing list

Reply via email to