Ty3uK / parcel-plugin-pug

Pug template support for Parcel bundler
MIT License
46 stars 6 forks source link

Attribute Interpolation failed #10

Closed yoyoys closed 6 years ago

yoyoys commented 6 years ago

I used variable for define relative path for resource. and it's okay when compiled with gulp. but i tried compiled with parcel, i got this error message, i think it's a wrong compile.

I'm using parcel-plugin-pug 0.2.5.

here is my structure:

_layout.pug
Test/
--test.pug

here is my code: _layout.pug

block vars
  -var basePath = '';

<!DOCTYPE html>
html(lang="en")
  head
    title Document
  body
    block content
    script(src=basePath+'assets/js/test1.js')

test.pug

extends ../_layout.pug

block vars
  -var base = '../'
block content
  h1 test

and here is the error : image

It compiled as './asePath+%27assets/js/test1.js'

Ty3uK commented 6 years ago

Yep, I know that problem. Fix it ASAP, thanks!

dolma commented 6 years ago

Had a similar problem with an href tag so I made a PR to fix it (#16)

Ty3uK commented 6 years ago

Fixed in PR, thanks @dolma!