-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add Vue.js support #1189
Comments
Thank you for this. Maybe you can add it to documentation? Since I don't use vue personally I am reluctant to manage its support. Alternately if you can take this job, then I am happy to review your PR :) |
Adding this would be nicer than documenting. I definitely am willing to see if I can add it, but it might take some time. To be honest I find it challenging to find the time to work on code in my spare time. |
@swashata I've had a little bit of time tonight. I've done a bare minimum implementation, I think I'm at a point where I can test it locally and then have a look at the unit tests. Please see the linked commit, any pointers would be nice since I'm completely new to this codebase. |
I took a look. Is |
I was not sure if it's required either. I want to get a working setup first and then try to refactor and see if it can be removed. At least the config telling TS to handle vue files is require. |
Maybe you can try and figure out if it works with Something like const vueRules = {
test: /\.vue$/,
loader: "vue-loader",
options: {
esModule: true,
},
};
// add it to the list of module rules if this.config.hasVue === true. |
Thank you for the input! I haven't been able to continue yet. I |
@swashata How should I test this locally? I tried using Sorry, this is probably a noob question and related to using Lerna (this is the first time it's in a project I'm working on). |
Hi @michaelw85, Sorry I got caught up in some other work. So from your findings, it seems like In anycase, I think, for now it is better to leave under userland. Extending webpack config is not really a big issue anyway with In the meanwhile, since I don't use vue at all, a repository of a vue based plugin where I can test the integration would be really helpful. |
@swashata I've set up a repo where I have implemented what I described in this thread. A working WordPress setup with Wpack + VueJS hello world example. I've created the WP setup with Bedrock, to get this setup working you will have to |
This has all been fantastic to see and am hopeful for anymore updates. Thanks for all your work @michaelw85 and @swashata! |
As the title explains, it would be nice to have a
vue: true
option instead of having to manually configure it.I've got a manual setup working for Vue + TS (with class component and .vue files support) and the following was needed:
NPM:
npm i -D vue vue-template-compiler vue-loader vue-class-component ts-loader babel-preset-typescript-vue @babel/plugin-proposal-decorators @babel/plugin-proposal-class-properties
wpackio.project.js:
Add a
vue-shim.d.ts
to your typings folder:Make sure your typings are loaded in your tsconfig.json, something like:
"typeRoots": ["node_modules/@types", "typings"]
For a working example using a child theme see: https://github.com/michaelw85/wp-bedrock-wpack-vuejs
The text was updated successfully, but these errors were encountered: