【问题标题】:webpack copyFiles fails on symbolic folderwebpack copyFiles 在符号文件夹上失败
【发布时间】:2022-12-26 05:23:08
【问题描述】:

我有一个 Symfony 项目。我使用作曲家安装了 CKEditor,然后

npm install -D ./vendor/myVendor/ckeditorPackage

安装包。它创建一个符号链接以确保 webpack 始终同步到 composer。 我加

.copyFiles([
{from: './node_modules/ckeditor4/', to: 'ckeditor/[path][name].[ext]', pattern: /\.(js|css)$/, includeSubdirectories: false},
{from: './node_modules/ckeditor4/adapters', to: 'ckeditor/adapters/[path][name].[ext]'},
{from: './node_modules/ckeditor4/lang', to: 'ckeditor/lang/[path][name].[ext]'},
{from: './node_modules/ckeditor4/plugins', to: 'ckeditor/plugins/[path][name].[ext]'},
{from: './node_modules/ckeditor4/skins', to: 'ckeditor/skins/[path][name].[ext]'},
{from: './node_modules/ckeditor4/vendor', to: 'ckeditor/vendor/[path][name].[ext]'}

])

到 webpack.config.js,但是在构建时失败了

   WARNING  The "from" option of copyFiles() should be set to an existing directory but "./node_modules/ckeditor4/" seems to be a file. Nothing will be copied for this copyFiles() config object. 

因为它是一个符号链接:

$ ls -l | grep cked
lrwxrwxrwx    1 user user    63 de jul.  29 13:00 ckeditor4 -> ../vendor/myVendor/ckeditorPackage

如何配置 webpack 以“跟随”符号链接?

【问题讨论】:

  • 我检查了一下,只有第一个 copyFile(直接在符号文件夹上的那个)失败了;如果我删除第一行错误就消失了(但这不是解决方案,因为文件没有被复制)

标签: webpack


【解决方案1】:

我有同样的问题,我用一个命令解决了它:

php hp bin/console ckeditor:install assets/ckeditor4

并将 copyFile 更改为使用 assets inst

【讨论】:

    猜你喜欢
    • 2018-08-09
    • 1970-01-01
    • 2017-12-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多