<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Specifying webpack entry point for @arcgis/core npm library to bundle into DLL build in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/specifying-webpack-entry-point-for-arcgis-core-npm/m-p/1302157#M81480</link>
    <description>&lt;P&gt;Will do, I'm still trying to experiment around with it. One thing I'm testing out is building my own entry point for&amp;nbsp;@arcgis/core and I noticed if you add an entry point to an index.js file in the webpack.config.js, and in the index.js file you include a dynamic import with a template string for&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/core like this, it can create a build of the entire dependency which is one step further:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;const dependency = '';

import(
    /* webpackMode: "lazy-once" */
    /* webpackExports: ["default", "named"] */
    `@arcgis/core/${dependency}.js`
).then(() =&amp;gt; {});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;With dynamic imports using a template string, it looks like webpack has to include everything possible for that module in the build, but the downside here is the DLL plugin's generated manifest.json ends up generating invalid JSON. Seems like it doesn't like dynamic imports very much...&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jun 2023 18:19:46 GMT</pubDate>
    <dc:creator>celliott</dc:creator>
    <dc:date>2023-06-22T18:19:46Z</dc:date>
    <item>
      <title>Specifying webpack entry point for @arcgis/core npm library to bundle into DLL build</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/specifying-webpack-entry-point-for-arcgis-core-npm/m-p/1302092#M81474</link>
      <description>&lt;P&gt;Hey all, I'm trying to create a DLL build with webpack that packages a number of npm dependencies so that they can be referenced within other webpack files. The issue I'm facing is that unlike some of the other dependencies, when I include &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/core&amp;nbsp;into the webpack.config.js entry vendor list and attempt to bundle it into the DLL build, I get errors that it cannot find a valid entry point/index.js file.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is there a something similar to an index.js file that I can use to specify as an entry point for the&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/core&amp;nbsp;module, or is there a way I can do something similar by creating my own entry point?&lt;BR /&gt;&lt;BR /&gt;For reference, this is all I'm doing in the webpack.config.js file right now:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;module.exports = {
    mode: "development",
    cache: true,
    entry: {
        vendor: ["react", "@arcgis/core"]
    },
    plugins: [
        new webpack.DllPlugin({
            context: __dirname,
            name: '[name]_[fullhash]',
            path: path.join(__dirname, 'dist', 'manifest.json')
        })
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 16:17:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/specifying-webpack-entry-point-for-arcgis-core-npm/m-p/1302092#M81474</guid>
      <dc:creator>celliott</dc:creator>
      <dc:date>2023-06-22T16:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying webpack entry point for @arcgis/core npm library to bundle into DLL build</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/specifying-webpack-entry-point-for-arcgis-core-npm/m-p/1302154#M81479</link>
      <description>&lt;P&gt;I was never able to get the DLL plugin to work with webpack. It might require scripting out all the files in the package to add, but even then, I don't know if it will work correctly with workers and wasm. Module federation might be an easier route. If you find a way, I'd love to hear about it.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 18:19:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/specifying-webpack-entry-point-for-arcgis-core-npm/m-p/1302154#M81479</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2023-06-22T18:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying webpack entry point for @arcgis/core npm library to bundle into DLL build</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/specifying-webpack-entry-point-for-arcgis-core-npm/m-p/1302157#M81480</link>
      <description>&lt;P&gt;Will do, I'm still trying to experiment around with it. One thing I'm testing out is building my own entry point for&amp;nbsp;@arcgis/core and I noticed if you add an entry point to an index.js file in the webpack.config.js, and in the index.js file you include a dynamic import with a template string for&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/core like this, it can create a build of the entire dependency which is one step further:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;const dependency = '';

import(
    /* webpackMode: "lazy-once" */
    /* webpackExports: ["default", "named"] */
    `@arcgis/core/${dependency}.js`
).then(() =&amp;gt; {});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;With dynamic imports using a template string, it looks like webpack has to include everything possible for that module in the build, but the downside here is the DLL plugin's generated manifest.json ends up generating invalid JSON. Seems like it doesn't like dynamic imports very much...&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 18:19:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/specifying-webpack-entry-point-for-arcgis-core-npm/m-p/1302157#M81480</guid>
      <dc:creator>celliott</dc:creator>
      <dc:date>2023-06-22T18:19:46Z</dc:date>
    </item>
  </channel>
</rss>

