-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Installing dependencies (like node-sass) in a custom theme #353
Comments
You should tell us the error stack first, then give the workaround. or I don't know what happened. |
This is the error stack:
And this is the way I'm using the dependency in the Layout.vue file:
If I remove that code, obviously it all works. |
What's your point? Running |
@meteorlxy No, adding the dependencies is not enough. I've just solved it adding a config.js in my repo with this:
With that, webpack will also look for sass-loader in my repo's node_modules. |
I repro this issue. I introduce
I think it should be re-opened. @ulivz |
@whoan Are you using I tried to make a repo to reproduce this issue, but failed. |
@meteorlxy I am not using I didn't have the problem using packages like Te reproduce the problem, add this code to a component: <style lang="scss">
#some {}
</style> .. add the following dependencies to your theme:
... and execute |
I tried to reproduce it for many times, but cannot reproduce it. :( So, could you guys provide us a reproduction repo for each issue? |
I have created a reproduction repo: https://github.com/ocavue/vuepress-saas-bug-example. You can find my reproduction steps in README.md
BTW, if I install $ cd vuepress-project
$ yarn add -D sass-loader node-sass
$ ls ./node_modules/ | grep sass
node-sass
sass-graph
sass-loader
$ yarn run dev # no error |
Any progress for this issue? (つ´ω`)つ I'm not sure if this is a bug. If not, could you point out my mistake since I'm not familiar with node and npm. |
I'm creating a custom theme for my blog and I don't find a way to avoid modifying the vuepress project itself, to make the theme build properly.
I am currently having problems with the following dependencies:
If I add them to vuepress itself it works fine but I have the idea to make the repo public, so I wish the repo was easy to install.
I tested modifying the file lib/webpack/createBaseConfig.js (with partial success) adding this line:
...it worked adding my custom theme to the vuepress project (in the folder docs/.vuepress/) but it didn't work with the vuepress cli (ie:
vuepress dev
failed).If it worked, I was thinking in make a PR to add that line to the vuepress repo but it seems it is not enough.
What is the correct way to handle this kind of dependencies in a custom theme?
Notice it's easier with other kind of assets (eg: bootstrap) and I could hanlde them creating a package.json in the custom theme and using the proper paths in my code.
This is my environment but I think it's not relevant in this case:
The text was updated successfully, but these errors were encountered: