Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make this project compatible with webpack #10

Open
stevefan1999-personal opened this issue Jul 29, 2020 · 3 comments · May be fixed by #11
Open

Make this project compatible with webpack #10

stevefan1999-personal opened this issue Jul 29, 2020 · 3 comments · May be fixed by #11

Comments

@stevefan1999-personal
Copy link

Hi, I'm working on a meta-transpiler that compiles Vue SFC blocks to different languages and I see that this project is very interesting because I can chain it up with hikerpig/vue-classify to convert classic Vue components into composition API indirectly, but I have some problem how to transpile it in Webpack.

I'm also using Nuxt too and I have added vc2c to build.transpile but I still got eslint, import-modules and various dependency missing error, and all of them are pointing to the missing dependency module, which is ridiculous and very spurious since I explicitly set to transpile this project.

I saw that your project uses Parcel and I quickly come up with a hack to point to src/index.ts and use the emitted file on my Nuxt website;. Indeed it worked but the bundle size is enormous, for 5.5MB. This is clearly not acceptable, so I want to ask you about whether you would switch to rollup and allow ESM passthrough, so I can also share some of the dependencies with other projects too? The biggest problem now is compile time because webpack has to again do compilation on the Parcel bundle which is quite meaningless...

@yoyo930021
Copy link
Owner

I don't need any bundled tools about main project.
Parcel is only used for demo page.
I don't know why webpack is breaking.
Maybe I will study this problem when free.

@stevefan1999-personal stevefan1999-personal linked a pull request Jul 31, 2020 that will close this issue
@stevefan1999-personal
Copy link
Author

stevefan1999-personal commented Jul 31, 2020

But the problem is you didn't supply a ESM version for bundlers that accept modern modules...I see you defaulted to use CommonJS which webpack can barely tree-shake to escape the module resolution & re-use problem between browsers and nodejs. I made some simple tweaks and assumptions to optimize this for multiple different use, would you like to review it?

Also, I see that there are also no Vuex conversion support, that's a pity but I know Vuex 4 is not yet finalized so...may I ask if you will like to research on that ASAP when Vuex 4 comes out, at least during RC?

Don't worry; tests are still passing, and CLI should work flawless too

@yoyo930021
Copy link
Owner

I just wanted to do it for node environment.
The demo is doing after main code. XD

Except, this project has some capability for convert classic Vue components into composition API.
But I'm not export about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants