Closed johannes-z closed 3 years ago
Hey Johannes.
Sorry about this.
Vue Class Component was added by a contributor to support Vuex Pathify decorators for vue-class-component.
At the time I was super-busy and hadn't used vue-class-component. There was some discussion around it here:
Eventually, this PR was the one that added it:
I'm happy to take a look at this again now, perhaps involve in original collaborator; it may be that I know more than I did then.
Do you have any thoughts on what would be a good way to move forward?
Shouldnt changing this line:
const createDecorator = require('vue-class-component').createDecorator
(https://github.com/davestewart/vuex-pathify/blob/master/src/helpers/decorators.js#L18)
to this:
import { createDecorator } from 'vue-class-component'
fix the issue? This way the dependency will actually be added in the final bundle.
My expertise in how rollup does its thing is not good enough to know if that will do the job, but you can have a crack yourself if you like.
You can use npm link
to make this pretty easy:
npm run build
to build the source in the pathify foldernpm link
to set up the link from the pathify foldernpm link vuex-pathify
from your project folder to point the pathify dependency to your local folderThat should at least get it running for you locally.
Want to have a go?
Sure I'll try. I'll come back to you when I have results.
I just tested it. It worked when I changed it to an import statement. I've opened a PR.
Good man!
I'm a little stacked for the next few days, but I will get to it.
You can use your link in the meantime.
If I haven't got to it by next week, bug me here :)
ping @davestewart
Describe the bug I'm bundling a library as UMD that uses vuex-pathify. This line breaks the build however:
var createDecorator$1 = require('vue-class-component').createDecorator;
This should be an
import
-statement inside the .esm build, I guess. See https://unpkg.com/browse/vuex-pathify@1.4.1/dist/vuex-pathify.esm.js Line 1100.Expected behaviour I'm already using
vue-class-component
in my bundle. This should not break my build.Additional context This probably only works in a cjs environment, not UMD/AMD.
Fixing version to
1.2.0
creates a working bundle. Every newer version breaks it.