Comments (4)
Hi! Thanks for the question. I don't know anything about how vue works or how it differs from any of the supported filetypes. Do you have links to more information on what you'd need that's vue specific? A sample vue repo with the output of a current run of dependency tree would help highlight the files that aren't parsed properly.
Once I better understand what's not working on vue codebases, we can scope what would need to change to support it properly.
Thanks!
from node-dependency-tree.
Thanks for your reply!
Background information: I use node-dependency-tree
in vscode-framegraph, a vscode-extension to show dependency tree.
About vue: vue is a font-end
frame like react
Simple Project : demo is a simple vue
project its dependency is like:
ps: get-dependency-tree is work on vue-project
, but is not work very well. maybe this can help you
Thanks Again
from node-dependency-tree.
Thanks for the extra detail! I appreciate it.
I think the hard part here is handling .vue components that have embedded html and css. To get that to work, you need a custom parser to be used on .vue files.
If you know of a well-supported library that can take in a vue file and return a JS AST, then it could be used to extract the imports from a .vue file. You could then possible use the commonjs module resolver to convert those extracted imports into concrete filepaths for recursive traversal.
https://github.com/dependents/node-dependency-tree#how-does-this-work is an attempt at explaining the flow and the main modules at play for finding dependencies and mapping those dependencies to files for traversal. I'd look at the way the typescript support works and see how vue support can map to that.
I don't use TS at all these days and haven't used Vue at all ever, so I can't really provide support myself (it would be naive and buggy, i'm sure). If you have the time and really want it in, I'm happy to answer questions or clarify the design of dependency-tree and its lower level modules. I welcome PRs and appreciate the help.
from node-dependency-tree.
I have fixed this problem. thank you for your explanation about node-dependency-tree
, it helps me a lot.
vue-template-es2015-compiler is a loader to get vue string code
and parse it's html template
,javascript code
,css module
. if you got the javascript string code
of vue file
, you can do what you want, maybe JS AST or anything else.
how to parse vue file showed how to parse vue file
. maybe this can help you.
Finally, I have fixed this problem. if you have time you can support vue file
in node-dependency-tree
. maybe this issue can be closed.
Thanks Again
from node-dependency-tree.
Related Issues (20)
- Unable to resolve directory dependencies HOT 4
- -
- npm i --global-style
- dynamic import with Typescript doesn't work. HOT 10
- Exclude unused import HOT 3
- Sass imports from node_modules HOT 1
- fix(tsconfig): path mapping (module alias)
- Out of memory without `--list-form` HOT 1
- Find dependents
- Why not supporting an object for webpackConfig parameter? HOT 1
- Don't support alias in webpack.config.js
- Node package.json exports field not understood.
- feat: list import identifiers in dep tree HOT 3
- Why is precinctOptions.includeCore always false?
- dependencyTree only returning an empty object HOT 2
- Help fix
- Miss typings definine in package.json `files` HOT 1
- Resolving local/nested node_modules folder
- Fix tests on Node.js 20 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-dependency-tree.