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: css-loader 1.0 removed alias #3741

Merged
merged 4 commits into from
Sep 19, 2018
Merged

fix: css-loader 1.0 removed alias #3741

merged 4 commits into from
Sep 19, 2018

Conversation

clarkdo
Copy link
Member

@clarkdo clarkdo commented Aug 16, 2018

Fixes issues with @/ for plugins and more.

Types of changes

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

Description

Related to #3723
Because css-loader has removed options.alias and is using loader-utils for url() now.
So this is a breaking change for <url>, users need to prefix ~ when they want to use alias:

Now: please use url(~assets)(recommend), url(~@/assets) or url(~~/assets)
Do not use: url(~/assets)

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 passed.

@clarkdo clarkdo changed the title [DO NOT MERGE] fix: css-loader 1.0 removed alias WIP [DO NOT MERGE] fix: css-loader 1.0 removed alias Aug 16, 2018
@clarkdo clarkdo changed the title WIP [DO NOT MERGE] fix: css-loader 1.0 removed alias [DO NOT MERGE] fix: css-loader 1.0 removed alias Aug 16, 2018
@pi0 pi0 mentioned this pull request Aug 24, 2018
clarkdo pushed a commit that referenced this pull request Aug 24, 2018
Remaining:

- For `css-loader`: #3741
- For `eslint`: #3494
- For `postcss`: #3679
@galvez galvez added the WIP label Aug 25, 2018
@galvez galvez changed the title [DO NOT MERGE] fix: css-loader 1.0 removed alias fix: css-loader 1.0 removed alias Aug 25, 2018
@clarkdo clarkdo requested review from pi0 and Atinux September 18, 2018 16:31
@clarkdo clarkdo removed the WIP label Sep 18, 2018
@codecov-io
Copy link

codecov-io commented Sep 19, 2018

Codecov Report

Merging #3741 into dev will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #3741   +/-   ##
=======================================
  Coverage   97.64%   97.64%           
=======================================
  Files          18       18           
  Lines        1231     1231           
  Branches      335      335           
=======================================
  Hits         1202     1202           
  Misses         28       28           
  Partials        1        1
Impacted Files Coverage Δ
lib/builder/webpack/utils/style-loader.js 100% <ø> (ø) ⬆️
lib/builder/webpack/base.js 98.43% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 65432e6...788546a. Read the comment docs.

@pi0 pi0 merged commit 1c34651 into nuxt:dev Sep 19, 2018
@husayt
Copy link
Contributor

husayt commented Sep 20, 2018

This breaks vuetify in a la-carte-mode.
https://vuetifyjs.com/en/guides/a-la-carte

Error msg is : Invalid or unexpected token

it is complaining at this line in latest 1.2.4 version of

require('../../../src/stylus/components/_app.styl');

in this file
...\node_modules\vuetify\es5\components\VApp\VApp.js

@clarkdo
Copy link
Member Author

clarkdo commented Sep 21, 2018

Could you provide a repo ? @husayt

@husayt
Copy link
Contributor

husayt commented Sep 22, 2018

Hi @clarkdo
here is repo with simple demo.
https://github.com/husayt/nuxt2-vuetify

latest commit works with "nuxt-edge": "2.0.0-25607354.1e02195",
the commit before then with "nuxt": "2.0.0" is broken.

Thanks

@husayt
Copy link
Contributor

husayt commented Sep 28, 2018

@clarkdo did the example I provide make sense, or do you need more info?

@clarkdo
Copy link
Member Author

clarkdo commented Sep 28, 2018

@husayt Sorry about that I have some personal stuff recently, I’ll look into it immediately when available.

@aldarund
Copy link

@husayt @clarkdo use transpile instead of config.externals & nodeExternals and it will work. I have same vuetify a la carte setup and it work fine.
PS in vuetify 1.3 it wont be needed due to auto a la carte

@husayt
Copy link
Contributor

husayt commented Sep 28, 2018

@aldarund thanks for a tip.

Here is a working config from me:

 build: {
    transpile: [/^vuetify/],
    babel: {
      plugins: [
        [
          "transform-imports",
          {
            vuetify: {
              transform: "vuetify/es5/components/${member}",
              preventFullImport: true
            }
          }
        ]
      ]
    },

@lock
Copy link

lock bot commented Oct 31, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 31, 2018
@clarkdo clarkdo deleted the css-loader-alias branch April 2, 2019 13:06
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants