Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to add a custom preprocessor doesn't appear to work #11

Closed
antony opened this issue Nov 2, 2018 · 1 comment
Closed

Trying to add a custom preprocessor doesn't appear to work #11

antony opened this issue Nov 2, 2018 · 1 comment

Comments

@antony
Copy link
Member

antony commented Nov 2, 2018

I'm trying to implement google structured data

However, upon trying to stop the plugin from processing these blocks of JSON, I think I've discovered that a custom compiler is not loaded correctly:

My configuration is as follows:

{
  transformers: {
    scss: {
      includePaths: [
        'node_modules',
        'src'
      ]
    },
    structuredData ({ content }) {
      return { code: content, map: '' }
    }
  },
  aliases: [
    ['application/ld+json', 'structuredData']
  ]
}

However, upon booting the app, I think it is trying to resolve the compiler incorrectly:

Error: Module build failed (from ./node_modules/svelte-loader/index.js):
Error: [svelte-preprocess] Error transforming 'structuredData'. Message:
Cannot find module './transformers/structuredData.js'
    at Object.exports.throwError.msg [as throwError] (/home/ant/Projects/beyonk-sapper/node_modules/svelte-preprocess/src/utils.js:25:9)

I expect it to use the function specified in transformers rather than try to load it from disk.

@kaisermann
Copy link
Member

Fixed on v2.4.1 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants