Bug:
If you import sass files from a node_module it will work on the dev server, but it fails when building the project.
Steps to reproduce:
File to import not found or unreadable: ~bulma.Expected behavior:
Importing node_modules works when building the project as well.
@ulivz - would you mind if I took a look at this?
You just used a wrong import path but didn't set any alias:
@import "~bulma";
remove the ~ instead.
@ulivz unfortunatly, this is not fixing the issue.
The prefix ~ should be fine, because it tells Webpack that this is not a relative path (for more information see: https://github.com/webpack-contrib/sass-loader#imports).
With the prefix the import works great in development (without the prefix, you will get an error message).
But during the build process, the import is not working.
I guess this may be an webpack issue, not finding the node_modules anymore?
Can we reopen the issue?
Hey! This is still not fixed.
@ulivz look at the docs: https://github.com/webpack-contrib/sass-loader#imports
@import ~xxxx IS valid :)
Hmm facing the same issue now. Are there any solutions or any hints why this problem exists?
To give an idea about my actual problem, I have something like this in my enhanceApp.js file:
import './styles.sass'
export default ({
Vue,
options,
router,
siteData
}) => {
}
I added the node-sass and sass-loader packages to preprocess the sass. On running vuepress dev docs the sass rules are included, but on running vuepress build docs there are not.
i don鈥檛 want to use any framework integration or wrapper!
How to use material-components-web?
Most helpful comment
@ulivz unfortunatly, this is not fixing the issue.
The prefix ~ should be fine, because it tells Webpack that this is not a relative path (for more information see: https://github.com/webpack-contrib/sass-loader#imports).
With the prefix the import works great in development (without the prefix, you will get an error message).
But during the build process, the import is not working.
I guess this may be an webpack issue, not finding the node_modules anymore?
Can we reopen the issue?