-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
How to watch file changes and run script? #1135
Comments
Hi. Would please explain more about your solution maybe we could help better? |
Hey @pi0 :) I want to be able to share variables in BOTH, sass and js. So here is my solution: I have my .json file with my variables:
This script inside the server.js now generates my sass file and puts it into assets/variables.sass.
Now I can import my sass variables
My plugin here makes all variables globally available with this.$styleVars
So now I can use my sass variables also in my components Example:
What I miss now is that I want my script in the server.js to reload, everytime a .vue or .sass file changes. Best Regards |
Hmm seems interesting :) Did you tried vue-styled-components? which i think tries to solve same problem. |
@pi0 that's for other people to update the static pages. |
I think currently the only way would be using webpack plugins. Advanced module and tapable system will come in next releases and probably useful for such cases. |
This is now possible using latest rc6 using module hooks. Please see:
|
@pi0 Nuxt only monitor the specified files and directories, such as pages, layouts and so on. I have added some other source folder, and at some point I need to cover some of the files in the pages directory. In other words that I want to dynamically modify the contents of the page at run time. Can you give me some good advice? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hey guys,
This may be a simple question, but I want to do something like this:
If a .vue file changes, I want to run some a script.
The script generates dynamically a .sass file which I want to import then in my component .sass files.
Maybe you have an idea :)
The text was updated successfully, but these errors were encountered: