Skip to content

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Nov 28, 2022

Description

Supersedes and closes #10762 (See for more context)

This PR adds on top of #10762, including:

  • Warn of default import of css through import analysis (dev only)
  • Warn globbing default import of css through glob plugin
  • Update CSS test. Default imports of CSS does not work with HMR.

Additional context

I got flaky sourcemap test failures locally and I'm not sure if it happens in CI too

example fail log
 FAIL  playground/css-sourcemap/__tests__/css-sourcemap.spec.ts > serve > linked css with import
SyntaxError: Unexpected end of JSON input
 ❯ new Converter node_modules/.pnpm/convert-source-map@1.9.0/node_modules/convert-source-map/index.js:70:48
     68|   if (opts.hasComment) sm = stripComment(sm);
     69|   if (opts.isEncoded) sm = decodeBase64(sm);
     70|   if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm);
       |                                                ^
     71| 
     72|   this.sourcemap = sm;
 ❯ Proxy.exports.fromComment node_modules/.pnpm/convert-source-map@1.9.0/node_modules/convert-source-map/index.js:149:10
 ❯ Module.extractSourcemap playground/test-utils.ts:291:10
 ❯ playground/css-sourcemap/__tests__/css-sourcemap.spec.ts:68:17

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.
@bluwy bluwy added the p3-significant High priority enhancement (priority) label Nov 28, 2022
@bluwy bluwy added this to the 4.0 milestone Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p3-significant High priority enhancement (priority)

3 participants