Skip to content
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

fix(config): compile type compatibility in css-loader v4 #9014

Merged
merged 2 commits into from Mar 22, 2021

Conversation

EvanMaFYH
Copy link

@EvanMaFYH EvanMaFYH commented Mar 18, 2021

set the css-loader's compileType option to icss

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

when nuxt upgrade the css-loader library to v4, it results in a break change
if you export your sass variables and import it in your vue file before, it works fine
however when the css-loader library is upgraded to v4, the css-loader's compileType option is module by default which causes the problem
for example:
in your variable.scss file

$primaryColor: blue;
:export{
  primaryColor: $primaryColor;
}

in your vue file

import variables from 'variable.scss'

before: we can get the expected value
now : the variables we get is '{}'

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

clarkdo
clarkdo previously approved these changes Mar 19, 2021
@clarkdo
Copy link
Member

clarkdo commented Mar 19, 2021

Can you please update test snapshot ?

@clarkdo clarkdo changed the title fix break change when css-loader upgrade to v4 fix(config): compile type compatibility in css-loader v4 Mar 19, 2021
@clarkdo clarkdo requested review from danielroe and pi0 March 19, 2021 18:32
@EvanMaFYH
Copy link
Author

Can you please update test snapshot ?

I have updated it

@EvanMaFYH EvanMaFYH requested a review from clarkdo March 22, 2021 05:08
@pi0 pi0 merged commit 89e8fe0 into nuxt:dev Mar 22, 2021
enwin pushed a commit to enwin/nuxt.js that referenced this pull request Mar 25, 2021
enwin added a commit to enwin/nuxt.js that referenced this pull request Mar 25, 2021
  chore(deps): update dependency @nuxt/components to ^2.1.4 (nuxt#9037)
  chore(deps): update all non-major dependencies (nuxt#9032)
  fix(server): avoid caching `.js` assets in development to fix HMR for safari (nuxt#9034)
  fix(vue-app): re-call `$fetch` if data is missing in payload (nuxt#9026)
  chore(deps): update all non-major dependencies (nuxt#9029)
  chore(deps): update dependency node-html-parser to v3 (nuxt#8886)
  fix(config): compile type compatibility in css-loader v4 (nuxt#9014)
  chore(deps): lock file maintenance (nuxt#9023)
  fix(vue-app): handle redirect functions in routes (nuxt#9024)
  chore(deps): update dependency globby to ^11.0.3 (nuxt#9025)
  fix(vue-app): use `app.context.route` to match components in server
  chore(deps): update all non-major dependencies (nuxt#9019)
@pi0 pi0 mentioned this pull request Mar 31, 2021
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants