Skip to content

SASS variables do not work if vue project path is changed #182

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

Closed
davydnorris opened this issue Jun 1, 2020 · 2 comments
Closed

SASS variables do not work if vue project path is changed #182

davydnorris opened this issue Jun 1, 2020 · 2 comments

Comments

@davydnorris
Copy link

davydnorris commented Jun 1, 2020

I often insert Vue client projects into a node server based app and have the node app serve the Vue components. Rather than have two separate projects, I combine them into a single one, and then alter vue.config.js so that vue finds the client as so:

module.exports = {
    outputDir: 'client/dist',

    transpileDependencies: ['vuetify'],

    configureWebpack: {
        context: __dirname + '\\client\\',
        resolve: {
            alias: {
                '@': __dirname + '\\client\\src'
            }
        }
    },
}

This has worked fine for my Vuetify projects until my latest where I needed to use SASS variables, and I found they were not being picked up. Upon digging I found that the path to the variables.scss/sass file is hard coded in this line:

if (!fileExists(api, `src/${path}`)) continue

Can this line be changed so that it uses a relative path, or even the '@' alias? What is a bit annoying is that the generated import statement does use the '@', so it's just the line that searches for the file that's broken

@davydnorris
Copy link
Author

davydnorris commented Jun 1, 2020

I found a hack to get things to work, but it's not pretty.

I had to create the expected directory structure in the root of my project and then create an empty file named /src/sass/variables.scss, but I had to leave the real file in the relative location.

Simply moving the file didn't work because the helper.js code adds the '@' when constructing the import path

@davydnorris
Copy link
Author

Condensed into new issue #187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant