Skip to content

When the only usage of __webpack_exports__ is in var __webpack_exports__ = {}; then do not render that line #20146

@dilyanpalauzov

Description

@dilyanpalauzov

webpack 5.103.0 generates var __webpack_exports__ = {}; in both production and development mode.

In addition in --mode development it includes

/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/       // define __esModule on exports
/******/       __webpack_require__.r = (exports) => {
/******/             if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/                 Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/             }
/******/             Object.defineProperty(exports, '__esModule', { value: true });
/******/       };
/******/ })();
/******/ 


// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

__webpack_exports__ does not get any other value, it is all the time {}.

I have in webpack.config.js:

    optimization: {
        minimize: false,
        concatenateModules: true
    },
    experiments: {
        outputModule: true
    },
    performance: {
        maxAssetSize: 300000,
        maxEntrypointSize: 300000
    },
    output: {
        library: {
            type: 'module'
        },
        filename: 'tui-calendar.js',
        publicPath: '/dist'
    },
  • When the only usage of __webpack_exports__ is var __webpack_exports__ = {};, then var __webpack_exports__ = {}; should not be emmited.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions