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

Webpack loader, syntax include with parameter looks doesn't work. #646

Closed
xkguq007 opened this issue Mar 30, 2022 · 2 comments
Closed

Webpack loader, syntax include with parameter looks doesn't work. #646

xkguq007 opened this issue Mar 30, 2022 · 2 comments

Comments

@xkguq007
Copy link

xkguq007 commented Mar 30, 2022

Sorry for I can't read Chinese.

below is very simple example showing bugs.
First example is working.
<?= ?>
rule is custom.

Example 1 It works.

// sample.art
<div id="content">
  hi
  <img src="../../image/placeholder.png" alt="al" />
  <?= text ?>

  {{ include './loadable.art' }}
</div>

// loadable.art
<div id="loadable" style="display: none;">loading...</div>

After web packing,

// webpacked/sample.art
<div id="content">
  hi
  <img ... />
  <?= text ?>

  <div id="loadable" style="display: none;">loading...</div>
</div>

However, when I build include with params, it looks error

Same example, but error!!

Example 2 Not works.

// sample.art
<div id="content">
  hi
  <img src="../../image/placeholder.png" alt="al" />
  <?= text ?>

  <%= include('./loadable.art', {key: 'value'}) %>

// loadable.art
<div id="loadable" style="display: none;">loading...</div>
</div>

// webpacked/sample.art
<div id="content">
  hi
  <img alt="al" />
  <?= text ?>

  &#60;div id=&#34;content&#34;&#62;
  hi
  &#60;img alt=&#34;al&#34; /&#62;
  &#60;?= text ?&#62;

  &#60;div id=&#34;loadable&#34; style=&#34;display: none;&#34;&#62;loading...&#60;/div&#62;
</div>

How can I pass parameter in include, and after Webpack, it works?

@xkguq007
Copy link
Author

Oh, I did horrible mistake.
It was <% not <%=

@704585069
Copy link

704585069 commented Oct 11, 2022 via email

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