<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>shared js files in different portlet project</title>
  <link rel="self" href="https://liferay.dev/ca/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120511535" />
  <subtitle>shared js files in different portlet project</subtitle>
  <id>https://liferay.dev/ca/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120511535</id>
  <updated>2026-05-14T02:40:16Z</updated>
  <dc:date>2026-05-14T02:40:16Z</dc:date>
  <entry>
    <title>RE: RE: shared js files in different portlet project</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120739292" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120739292</id>
    <updated>2021-04-22T12:33:29Z</updated>
    <published>2021-04-22T12:33:29Z</published>
    <summary type="html">&lt;p&gt;compileInclude has no effect on load times. It will copy everything
  from the library you reference via compileInclude into the target
  bundle, but that doesn't change anything on the http level.&lt;/p&gt;
&lt;p&gt;If you can go without it (and you can): You should. There are enough
  other solutions to the problem here.&lt;/p&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2021-04-22T12:33:29Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: shared js files in different portlet project</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120741113" />
    <author>
      <name>Hairi Lani</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120741113</id>
    <updated>2021-04-22T10:00:32Z</updated>
    <published>2021-04-22T10:00:32Z</published>
    <summary type="html">&lt;p&gt;come back with same question.&lt;/p&gt;
&lt;p&gt;this make the portlet hang because access this approach is too slow.&lt;/p&gt;
&lt;p&gt;If I use compileInclude, it will package in the same bundle?&lt;/p&gt;
&lt;p&gt;Because its placed in META-INF&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</summary>
    <dc:creator>Hairi Lani</dc:creator>
    <dc:date>2021-04-22T10:00:32Z</dc:date>
  </entry>
  <entry>
    <title>RE: shared js files in different portlet project</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120519072" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120519072</id>
    <updated>2020-12-28T12:53:42Z</updated>
    <published>2020-12-28T12:53:42Z</published>
    <summary type="html">&lt;p&gt;You should build a &lt;a
  href="https://github.com/liferay/liferay-blade-samples/tree/7.3/liferay-workspace/themes/theme-contributor"&gt;Theme-Contributor&lt;/a&gt;,
  which can add JS resources (as well as CSS) without touching a theme.&lt;/p&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2020-12-28T12:53:42Z</dc:date>
  </entry>
  <entry>
    <title>RE: shared js files in different portlet project</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120517649" />
    <author>
      <name>Anji E</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120517649</id>
    <updated>2020-12-26T22:48:47Z</updated>
    <published>2020-12-26T22:48:47Z</published>
    <summary type="html">&lt;p&gt;1. You can create a separate portlet (js-portlet)&lt;/p&gt;
&lt;p&gt;2. Add Js logic &lt;/p&gt;
&lt;p&gt;3. Place the portlet on the same page. &lt;/p&gt;
&lt;p&gt;4. You can control displaying  of other portlets until js-portlet
  gets load by Liferay.portlet.ready() function in theme.&lt;/p&gt;</summary>
    <dc:creator>Anji E</dc:creator>
    <dc:date>2020-12-26T22:48:47Z</dc:date>
  </entry>
  <entry>
    <title>RE: shared js files in different portlet project</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120512444" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120512444</id>
    <updated>2020-12-23T13:45:30Z</updated>
    <published>2020-12-23T13:45:30Z</published>
    <summary type="html">&lt;p&gt;Hi ,&lt;/p&gt;
&lt;p&gt;One way is to create war mvc portlet and add the js file under
  /src/main/webapp/main.js, and this js can be referred in any module by
  script tag&lt;/p&gt;
&lt;p&gt;Ex.&lt;/p&gt;
&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td id="LC45"&gt;&lt;pre&gt;&lt;code class="language-html"&gt;&amp;lt;script src=&amp;quot;/o/js-util/js/main.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
        &lt;p&gt; &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;
      &lt;td id="L46"&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2020-12-23T13:45:30Z</dc:date>
  </entry>
  <entry>
    <title>shared js files in different portlet project</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120511534" />
    <author>
      <name>Hairi Lani</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120511534</id>
    <updated>2020-12-22T03:55:31Z</updated>
    <published>2020-12-22T03:55:31Z</published>
    <summary type="html">&lt;p&gt;Hi all.&lt;/p&gt;
&lt;p&gt;Let say I have 2 portlet in different projects. (hq-task-web and branch-task-web)&lt;/p&gt;
&lt;p&gt;Both portlet have common js function calculateDateline.js&lt;/p&gt;
&lt;p&gt;Can I put this js file in common project so that both portlets can
  use it? (Except in themes)&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;/Hairi&lt;/p&gt;</summary>
    <dc:creator>Hairi Lani</dc:creator>
    <dc:date>2020-12-22T03:55:31Z</dc:date>
  </entry>
</feed>
