LearnNewsExamplesServices
Frontmatter
id517
titlewebpack.config.main => different asset names in mode prod
stateClosed
labels
enhancement
assigneestobiu
createdAtMay 1, 2020, 11:32 AM
updatedAtMay 1, 2020, 11:34 AM
githubUrlhttps://github.com/neomjs/neo/issues/517
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 1, 2020, 11:34 AM

webpack.config.main => different asset names in mode prod

tobiu
tobiu commented on May 1, 2020, 11:32 AM

dev-build-main:

                   Asset      Size                 Chunks             Chunk Names
                 main.js   405 KiB                   main  [emitted]  main
src/main/lib/AmCharts.js  21.8 KiB  src/main/lib/AmCharts  [emitted]  src/main/lib/AmCharts

prod-build-main:

  Asset      Size  Chunks             Chunk Names
   1.js  2.29 KiB       1  [emitted]  src/main/lib/AmCharts
main.js  41.5 KiB       0  [emitted]  main

the asset names in dev & prod do not match, obviously we want the dev version one.

the chunk name is defined indirectly in Main.mjs:

if (Neo.config.useAmCharts) {
    await import(/* webpackChunkName: 'src/main/lib/AmCharts' */ './main/lib/AmCharts.mjs');
}
tobiu added the enhancement label on May 1, 2020, 11:32 AM
tobiu assigned to @tobiu on May 1, 2020, 11:32 AM
tobiu referenced in commit c9fb0df - "webpack.config.main => different asset names in mode prod #517" on May 1, 2020, 11:33 AM
tobiu
tobiu May 1, 2020, 11:34 AM
                   Asset      Size  Chunks             Chunk Names
                 main.js  41.5 KiB       0  [emitted]  main
src/main/lib/AmCharts.js  2.29 KiB       1  [emitted]  src/main/lib/AmCharts

chunkFilename: '[name].js'

fixes this in prod.

tobiu closed this issue on May 1, 2020, 11:34 AM