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

feat(css): deprecate css default export #11094

merged 10 commits into from
Nov 28, 2022

feat(css): deprecate css default export #11094

merged 10 commits into from
Nov 28, 2022


Copy link

@bluwy bluwy commented Nov 28, 2022


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);
       |                                                ^
     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
p3-significant High priority enhancement (priority)
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants