Skip to content

CLI Beta-15: vue.config.js merge with global scss vars no longer working #1511

@adam-t-b

Description

@adam-t-b

Version

3.0.0-beta.15

Reproduction link

https://github.com/adam-t-b/CLI3-Sass-Loader-Repro/tree/master/sass-test

Steps to reproduce

  1. pull down provided test repo
  2. npm install
  3. npm run serve

What is expected?

The variable used on line 23 of App.vue should be imported from the bootstrap vars.

What is actually happening?

error in ./src/App.vue?vue&type=style&index=0&lang=scss

Module build failed:
undefined
^
Undefined variable: "$gray-400".
in C:\Users\Adam\Documents\CLI3-Sass-Loader-Repro\sass-test\src\App.vue (line 23, column 12)


I've setup the vue.config.js to import the global vars from the bootstrap node_modules location ( using ~ per sass-loader docs) See the config. Also, I've pre-run the vue inspect > webpackConfigOutput.json. It correctly shows the sass-loader data option on lines 544-551.

In 3.0.0-beta.11 My vue.config.js worked correctly, but threw errors only on my Jenkins server. See: https://forum.vuejs.org/t/modulebuilderror-undefined-variable-when-attempting-to-build-app-on-jenkins-server/35562
I was never able to figure out why it only failed when I ran on a clean CI build.

One of my paths to test things was to upgrade to 3.0.0-beta.15. Now, I can no longer pull in global vars even when I run locally. Without this, i'm forced to put the import statement at the top of every single .vue file.. which is not great for maintenance, and also is contrary to vue documentation on how to setup global vars.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions