NightlyCommit / twing-loader

*** This project is now hosted in GitLab ***
https://gitlab.com/nightlycommit/twing-loader
12 stars 13 forks source link

Ignore loader chaining #2

Open ryuran opened 5 years ago

ryuran commented 5 years ago

Hello

https://github.com/nicolasRdr/twing-loader/blob/master/src/loader.js#L15 This line use this.ressource it’s the path of original file and not the result of previous loaders.

We should une sourceData here

module.exports = async function loader(sourceData) {

But I don't know how use it with Twing API. Maybe @ericmorand can help

DerekRoth commented 5 years ago

yes this is indeed a quick and imperfect Twing loader implementation. Using the result of previous loaders is apparently more complicated than it seems because of the fact that Twig requires file names for many features. If you can think of a fix, feel free to submit a PR :)

ericmorand commented 5 years ago

@ryuran could you please provide an example of webpack config that fails? I'd like to add it the the integration test suite of my loader - and hopefully next version of this one.

It uses the source parameter to compile the template:

https://github.com/ericmorand/twing-loader/blob/master/src/index.ts

But I still need to test it with your config - or a relevant subset of it.

ericmorand commented 5 years ago

@ryuran Could you give twing-loader@2 a try?

ryuran commented 5 years ago

As soon as i'm back from vacation

ryuran commented 2 years ago

ho damn. my vacation wasn't so long… I don't work anymore with twig/twing.