Closed mario-minati closed 6 years ago
Looks like what is different from my test app and your code is that I specify the extension. Like this:
import App from './App.vue'
Does the test run for you?
Cloning the repo and testing rollup.t was not sucessfull. I attached the bash output: rollup.t.log
I got these results on a pretty new clean vm using mate ubuntu. The npm -v output is attached.
Do we run into issues with npm changes?
That might be... I thought I had cleaned up my node_modules, but I have to look at it again.
Hopefully get back to you tomorrow or on Monday.
This should be fixed now in version 2.06.
Note though that I had to change the attributes to be compatible with the new rollup API.
Sorry, but we still cannot prove rollup.t. Attached is the log of testing a new repo clone: rollup.t.v2.06.log
Maybe you can look at it again. Can I help with any further files or tests.
I don't think you're running 2.06, since it does not generate that line of plugins. It creates this:
plugins: [resolve({}),commonjs({"sourceMap":true}),terser({}),vue()]
You need to run prove -l
if you want to load from ./lib
instead of the installed version on your system.
Sorry, your are right, tests are now passing nicely.
Thanks for your time && help.
Further testing revelead that ./example/rollup.pl needs to be fixed:
unshift @{app->asset->pipe('RollupJs')->plugins}, ["rollup-plugin-vue", "VuePlugin"];
You have to install
npm i vue-template-compiler --save-dev
by hand otherwise the example rollup.pl will not be compiled, maybe this can go into the docs. :-)
The example should work as well now.
We are trying to create a multipage app with Mojolicious, VueJS and AssetPack using the RollupJS Pipe.
The startup code is working so far as expected:
The main.js is somewhat straight forward:
Starting morbo leads to the following error:
While trying to find out what the reason is, we stumbled upon an unexpected return value in the nodejs code generated from RollupJS.
push @import, "var $func = require('$plugin');\n";
This returns an Object:
{ default: [Function: VuePlugin] }
After adding some fixing code to RollupJS
push @import, "if (typeof $func == 'object') {$func = $func.default};\n";
We still cannot sucessfully run the code:
The not found file './App' is there, is it named 'App.vue'. What has to be done, that '*.vue'-files are handled appropriatly?