mintbit / jekyll-node-module

Include node module assets in your Jekyll build
MIT License
9 stars 1 forks source link

map file failes to copy #3

Closed ReenigneArcher closed 1 month ago

ReenigneArcher commented 1 month ago

The following configuration results in an error when building the jekyll site.

node_modules:
  modules_dir: node_modules
  assets:
    js: assets/js
    css: assets/css
  copy:
    - source: "bootstrap/dist/css/bootstrap.min.css.map"
      target: assets/css
    - source: "@fortawesome/fontawesome-free/webfonts/"
      target: assets/webfonts
    - source: "@fontsource/lora/files/"
      target: assets/css/files
    - source: "@fontsource/open-sans/files/"
      target: assets/css/files
Configuration file: /app/_config.yml
2024-09-11T01:46:45.214629681Z Configuration file: /app/_config_local.yml
2024-09-11T01:46:45.241803058Z             Source: /app
2024-09-11T01:46:45.241835200Z        Destination: /app/_site
2024-09-11T01:46:45.241841622Z  Incremental build: disabled. Enable with --incremental
2024-09-11T01:46:45.241846462Z       Generating... 
2024-09-11T01:46:45.934205987Z           Conflict: The following destination is shared by multiple files.
2024-09-11T01:46:45.934271013Z                     The written file may end up with unexpected contents.
2024-09-11T01:46:45.934281944Z                     /app/_site/assets/css/index.css
2024-09-11T01:46:45.934288647Z                      - /app/node_modules/@fontsource/lora/index.css
2024-09-11T01:46:45.934293246Z                      - /app/node_modules/@fontsource/open-sans/index.css
2024-09-11T01:46:45.934296622Z                     
2024-09-11T01:46:45.946619321Z            Copying: /app/node_modules/bootstrap/dist/css/bootstrap.min.css.map => /app/_site/assets/css
2024-09-11T01:46:45.947396218Z bundler: failed to load command: jekyll (/usr/local/bundle/bin/jekyll)
2024-09-11T01:46:45.947701701Z /usr/local/lib/ruby/3.3.0/fileutils.rb:2279:in `initialize': Is a directory @ rb_sysopen - /app/_site/assets/css/. (Errno::EISDIR)
2024-09-11T01:46:45.947734404Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:2279:in `open'
2024-09-11T01:46:45.947744123Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:2279:in `block in copy_file'
2024-09-11T01:46:45.947753962Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:2278:in `open'
2024-09-11T01:46:45.947759393Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:2278:in `copy_file'
2024-09-11T01:46:45.947764162Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:2243:in `copy'
2024-09-11T01:46:45.947768510Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:1048:in `block in copy_entry'
2024-09-11T01:46:45.947773009Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:2385:in `wrap_traverse'
2024-09-11T01:46:45.947777688Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:1045:in `copy_entry'
2024-09-11T01:46:45.947782778Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:990:in `block in cp_r'
2024-09-11T01:46:45.947789581Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:2469:in `block in fu_each_src_dest'
2024-09-11T01:46:45.947797096Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:2483:in `fu_each_src_dest0'
2024-09-11T01:46:45.947801805Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:2467:in `fu_each_src_dest'
2024-09-11T01:46:45.947806744Z  from /usr/local/lib/ruby/3.3.0/fileutils.rb:989:in `cp_r'
2024-09-11T01:46:45.947811564Z  from /usr/local/bundle/gems/jekyll-node-module-0.1.3/lib/jekyll-node-module/hook.rb:12:in `block (2 levels) in <top (required)>'
2024-09-11T01:46:45.947816523Z  from /usr/local/bundle/gems/jekyll-node-module-0.1.3/lib/jekyll-node-module/hook.rb:5:in `each'
2024-09-11T01:46:45.947821062Z  from /usr/local/bundle/gems/jekyll-node-module-0.1.3/lib/jekyll-node-module/hook.rb:5:in `block in <top (required)>'
2024-09-11T01:46:45.947831072Z  from /usr/local/bundle/gems/jekyll-4.3.3/lib/jekyll/hooks.rb:103:in `block in trigger'
2024-09-11T01:46:45.947836482Z  from /usr/local/bundle/gems/jekyll-4.3.3/lib/jekyll/hooks.rb:102:in `each'
2024-09-11T01:46:45.947841031Z  from /usr/local/bundle/gems/jekyll-4.3.3/lib/jekyll/hooks.rb:102:in `trigger'
2024-09-11T01:46:45.947845119Z  from /usr/local/bundle/gems/jekyll-4.3.3/lib/jekyll/site.rb:234:in `write'
2024-09-11T01:46:45.947849327Z  from /usr/local/bundle/gems/jekyll-4.3.3/lib/jekyll/site.rb:82:in `process'
2024-09-11T01:46:45.947853345Z  from /usr/local/bundle/gems/jekyll-4.3.3/lib/jekyll/command.rb:28:in `process_site'
2024-09-11T01:46:45.947857823Z  from /usr/local/bundle/gems/jekyll-4.3.3/lib/jekyll/commands/build.rb:65:in `build'
2024-09-11T01:46:45.947865989Z  from /usr/local/bundle/gems/jekyll-4.3.3/lib/jekyll/commands/build.rb:36:in `process'
2024-09-11T01:46:45.947873774Z  from /usr/local/bundle/gems/jekyll-4.3.3/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
2024-09-11T01:46:45.947878253Z  from /usr/local/bundle/gems/jekyll-4.3.3/lib/jekyll/command.rb:91:in `each'
2024-09-11T01:46:45.947892190Z  from /usr/local/bundle/gems/jekyll-4.3.3/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
2024-09-11T01:46:45.947899294Z  from /usr/local/bundle/gems/jekyll-4.3.3/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
2024-09-11T01:46:45.947904764Z  from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
2024-09-11T01:46:45.947914333Z  from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
2024-09-11T01:46:45.947919122Z  from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
2024-09-11T01:46:45.947923551Z  from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
2024-09-11T01:46:45.947927769Z  from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
2024-09-11T01:46:45.947932017Z  from /usr/local/bundle/gems/jekyll-4.3.3/exe/jekyll:15:in `<top (required)>'
2024-09-11T01:46:45.947936055Z  from /usr/local/bundle/bin/jekyll:25:in `load'
2024-09-11T01:46:45.947940203Z  from /usr/local/bundle/bin/jekyll:25:in `<top (required)>'
2024-09-11T01:46:45.947944522Z  from /usr/local/lib/ruby/3.3.0/bundler/cli/exec.rb:58:in `load'
2024-09-11T01:46:45.947949070Z  from /usr/local/lib/ruby/3.3.0/bundler/cli/exec.rb:58:in `kernel_load'
2024-09-11T01:46:45.947956886Z  from /usr/local/lib/ruby/3.3.0/bundler/cli/exec.rb:23:in `run'
2024-09-11T01:46:45.947963879Z  from /usr/local/lib/ruby/3.3.0/bundler/cli.rb:455:in `exec'
2024-09-11T01:46:45.947966384Z  from /usr/local/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
2024-09-11T01:46:45.947968668Z  from /usr/local/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
2024-09-11T01:46:45.947970943Z  from /usr/local/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
2024-09-11T01:46:45.947973187Z  from /usr/local/lib/ruby/3.3.0/bundler/cli.rb:35:in `dispatch'
2024-09-11T01:46:45.947975512Z  from /usr/local/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
2024-09-11T01:46:45.947978487Z  from /usr/local/lib/ruby/3.3.0/bundler/cli.rb:29:in `start'
2024-09-11T01:46:45.947982926Z  from /usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.16/exe/bundle:28:in `block in <top (required)>'
2024-09-11T01:46:45.947987285Z  from /usr/local/lib/ruby/3.3.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
2024-09-11T01:46:45.947992034Z  from /usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.16/exe/bundle:20:in `<top (required)>'
2024-09-11T01:46:45.947995831Z  from /usr/local/bin/bundle:25:in `load'
2024-09-11T01:46:45.948000210Z  from /usr/local/bin/bundle:25:in `<main>'

The fatal error is a result of adding the following lines:

    - source: "bootstrap/dist/css/bootstrap.min.css.map"
      target: assets/css
schristm commented 1 month ago

Hi @ReenigneArcher,

The issue seems to be that you're trying to copy an individual file, and it's expecting a directory. If you try this instead, do you get the results you're looking for?

- source: "bootstrap/dist/css/"
  target: assets/css
ReenigneArcher commented 1 month ago

Ah, that probably is the issue. Thank you for the fast reply! I will try it later today.

ReenigneArcher commented 1 month ago

Copying the directory works, thank you.

schristm commented 1 month ago

Right on, you bet.