MoOx / metalsmith-rename

metalsmith plugin to rename entries
MIT License
6 stars 1 forks source link

how to debug this plugin #1

Open oupala opened 6 years ago

oupala commented 6 years ago

I'm trying to use metalsmith-rename and I'm having some difficulty to make it work properly.

I declared the plugin in my metalsmith script and I use it:

rename             = require('metalsmith-rename'),
[...]
    .use(rename([
        [/\.css$/, ".scss"]
    ]))

But when I try to build my website, I get an error:

Error: [metalsmith-sass] Error: File to import not found or unreadable: monokai-sublime.scss. -> /home/user/metalsmith/src/scss/app.scss:4:1

It appears that the css files are not renamed to scss. Could it be due to the fact that css files are stored in the node_modules directory instead of the src directory?

oupala commented 6 years ago

I added some code in order to include files from outside the src directory but this does not help:

    [...]
    .use(assets({
      source: './node_modules/highlight.js/styles',
      destination: './vendor/css'
    }))
    .use(rename([
      [/\.css$/, ".scss"]
    ]))
    [...]

Although I add css files from highlight.js to the metalsmith pipeline, they cannot be renamed inside the pipeline so that metalsmith-sass can process them.