spence-s / simple-pug-loader

Simpler than pug-loader
https://www.npmjs.com/package/simple-pug-loader
MIT License
14 stars 4 forks source link

Is this a drop-in replacement for pug-loader? #4

Closed BassOfBass closed 3 years ago

BassOfBass commented 3 years ago

Because I get a bunch of

Module parse failed: Unterminated string constant (27:19)
  - File was processed with these loaders:
  - * ./node_modules/html-webpack-plugin/lib/loader.js
  - * ./node_modules/simple-pug-loader/index.js
  - You may need an additional loader to handle the result of these loaders.

thrown while using this.

spence-s commented 3 years ago

In some situations it will work out of the box - but its not a drop in replacement. pug-loader will attempt to inline includes I believe where as this package just uses pug. If you can make a reproducible example I am happy to help debug.

BassOfBass commented 3 years ago

For some reason the repro doesn't throw any errors, so I'll just show errors according to this branch (btw I am not using any includes, so it couldn't be the source of problems). If you really want to look at the errors, you can clone it and run npm install && npm run dev in it.

At first I thought at least the second error has to do something with a template literal spanning several lines, but exact same structure in repro works fine. Also is there a reason these errors get duplicated 4 times?

spence-s commented 3 years ago

@BassOfBass thanks so much for filing the issue! I found a core bug that was causing the compiled functions to break lines inside of strings. It has nothing to do with your code. Please install version 0.1.2 by running npm install simple-pug-loader and retry - it should work well for you now.