在 nuxt 中排除 webpack 中的文件

Dav*_*vid 9 webpack vue.js nuxt.js

我已将一些文件添加到我的 nuxt 项目中。文件存储在./content目录中。现在我们收到了一些警告,如下所示:

WARN  in ./content/config.yml

Module parse failed: Unexpected token (9:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
Run Code Online (Sandbox Code Playgroud)

为了防止出现错误,我尝试排除nuxt.config.js. 我添加了以下几行,但警告并没有消失。

build: {
  /*
  ** You can extend webpack config here
  */
  extend (config, ctx) {
    config.module.rules.push({
      test: /\.yml$/,
      exclude: [
        path.resolve(__dirname, '/content/config.yml')
      ]
    }
  )
  }
}
Run Code Online (Sandbox Code Playgroud)

还有其他选项可以防止出现警告吗?