Неверный синтаксис конфигурации дескриптора записи Webpack - PullRequest
1 голос
/ 24 марта 2020

Итак, я пытаюсь настроить мою конфигурацию webpack для использования синтаксиса дескриптора записи, как описано здесь .

Это пример моей конфигурации:

    entry: {
      shared: [
        'react',
        'prop-types',
        'lodash',
        'moment',
        './src/utils/polyfills.js',
    ],
    index: { import: './src/index.js', dependOn: 'shared' },
  }

Однако, когда я запускаю свою сборку, я постоянно вижу ошибки, говорящие, что этот синтаксис не соответствует их API.

Команда запуска: "dev": "webpack --watch --config webpack.client. js"

Ошибка

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.entry should be one of these:
   function | object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string]
   -> The entry point(s) of the compilation.
   Details:
    * configuration.entry['index'] should be a string.
      -> The string is resolved to a module which is loaded upon startup.
    * configuration.entry['index'] should be an array:
      [non-empty string]
      -> A non-empty array of non-empty strings
    * configuration.entry['index'] should be one of these:
      [non-empty string]
      -> All modules are loaded upon startup. The last one is exported.
    * configuration.entry['index'] should be one of these:
      non-empty string | [non-empty string]
      -> An entry point with name

Кто-нибудь видел это раньше? ? Есть идеи?

1 Ответ

0 голосов
/ 09 апреля 2020

Какую версию веб-пакета вы использовали? Я думаю, что дескриптор записи доступен на v5 https://github.com/webpack/webpack/releases/tag/v5.0.0-beta.14

...