Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Improve resolve.extensions parity with webpack 4's default #1067

Closed
edmorley opened this issue Sep 2, 2018 · 0 comments · Fixed by #1080
Closed

Improve resolve.extensions parity with webpack 4's default #1067

edmorley opened this issue Sep 2, 2018 · 0 comments · Fixed by #1080
Assignees
Milestone

Comments

@edmorley
Copy link
Member

edmorley commented Sep 2, 2018

Running neutrino --inspect on master with the @neutrinojs/react preset, the resolve.extensions configuration is:

{
  // ...
  resolve: {
    extensions: [
      '.js',
      '.jsx',
      '.vue',
      '.ts',
      '.tsx',
      '.mjs',
      '.json'
    ]
  }

The webpack 4 default is ['.wasm', '.mjs', '.js', '.json'].

Comparing the two, there are a few issues:

  1. Neutrino's is missing .wasm
  2. The order matters, and the order differs from the webpack default (for example a package might provide both an .mjs and a .js to simulataneously support both newer and older tooling, and the current Neutrino order would mean the legacy .js gets used instead of the .mjs).
  3. It includes TypeScript even though we don't actually otherwise support TypeScript for now (which apparently contributed towards the issues in @neutrinojs/jest doesn't work transformer overrides for typescript #1044)

(It's also unfortunate that we have to include unrelated file extensions such as .vue, but unless we completely overhaul the middleware API per #239 (comment) then there's no way to allow presets to declare additional extensions, without earlier presets then being configured incorrectly.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

2 participants