1

我需要将文件从 node_modules 复制到目录 web/bundles/myBundle/components

但现在我有一个错误:错误:EISDIR:对目录的非法操作,打开'/srv/project/web/bundles/myBundle/components'

Encore
  .setOutputPath('web/bundles/myBundle/')
  .setPublicPath('/bundles/myBundle')
  .addEntry('myBundle', './app.js')
  .copyFiles({
  from: './src/project/myBundle/Resources/public/components',
  to: 'components',
});

我只需要复制文件,我试过了,但我不想指定 addEntry 因为没有(空的 js 文件只是为了解决问题)。

如果您有任何想法或解决方案,谢谢!

4

1 回答 1

2

将“to:”行更改为以下内容

to: 'components/[path][name].[ext]',

方括号中的元素是关键字,在复制过程中将替换为每个文件的真实路径/文件名/扩展名

于 2019-09-04T08:34:28.557 回答