You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
webpackIgnore: true is ignored, dynamic import/require still processed #11311
/***/"./x.js":
/*!**************!*\ !*** ./x.js ***! \**************//*! no static exports found *//***/(function(module,exports,__webpack_require__){constpackageName="net"constx=__webpack_require__("./ sync recursive")(packageName);/***/})
What is the expected behavior?
x.bundle.js should look like this (e.g. no dynamic require parsing due to the ignore comment) so that it doesn't crash when the module is available to be loaded by NodeJS.
/***/"./x.js":
/*!**************!*\ !*** ./x.js ***! \**************//*! no static exports found *//***/(function(module,exports,__webpack_require__){constpackageName="net"constx=require(packageName);/***/})
webpackIgnore is only for import() not for require
@sokra Ohh, maybe turn this into a feature request then? I need the webpackIgnore to work for require because ts-loader compiles the import down to require (need the commonjs module resolution because it's a NodeJS project).
Send a PR to add magic comments for require(). There are more possible comments that could apply here: webpackExports, webpackInclude, webpackExclude, webpackIgnore
Send a PR to add magic comments for require(). There are more possible comments that could apply here: webpackExports, webpackInclude, webpackExclude, webpackIgnore
@sokra Here's the PR #11316
Only added webpackIgnore because that's the one I need and fully understand, never needed or used the other ones.
@kolserdav Do you mean the webpackIgnore magic comment or something else? If yes, can you please create a simplified test repo where the issue can be observed?
Hi, @petermetz. Thank you for your reply! Actually I see now that it works fine. My issue were connected with my code delivery. I use the bundle in my Next.js application and it make bundle with webpack but the bundle in production mode have no comments and so it's producing a wrong result.
Activity
alexander-akait commentedon Aug 12, 2020
Please create reproducible test repo, maybe babel/typescript remove comments
petermetz commentedon Aug 12, 2020
@evilebottnawi Thank you for the response!
Repo: https://github.com/petermetz/webpack-11311
alexander-akait commentedon Aug 12, 2020
@petermetz 404
petermetz commentedon Aug 12, 2020
@evilebottnawi Oops, try now please. Set the visibility to public just now.
sokra commentedon Aug 12, 2020
webpackIgnore is only for
import()not forrequirepetermetz commentedon Aug 12, 2020
@sokra Ohh, maybe turn this into a feature request then? I need the webpackIgnore to work for require because ts-loader compiles the import down to require (need the commonjs module resolution because it's a NodeJS project).
sokra commentedon Aug 12, 2020
Send a PR to add magic comments for
require(). There are more possible comments that could apply here:webpackExports,webpackInclude,webpackExclude,webpackIgnorepetermetz commentedon Aug 12, 2020
@sokra Here's the PR #11316
Only added
webpackIgnorebecause that's the one I need and fully understand, never needed or used the other ones.webpack-bot commentedon Nov 12, 2020
This issue had no activity for at least three months.
It's subject to automatic issue closing if there is no activity in the next 15 days.
alexander-akait commentedon Nov 13, 2020
bump
kolserdav commentedon Sep 10, 2024
It only works for --mode=development, in production it doesn't work for me.
petermetz commentedon Sep 10, 2024
@kolserdav Do you mean the
webpackIgnoremagic comment or something else? If yes, can you please create a simplified test repo where the issue can be observed?kolserdav commentedon Sep 11, 2024
Hi, @petermetz. Thank you for your reply! Actually I see now that it works fine. My issue were connected with my code delivery. I use the bundle in my
Next.jsapplication and it make bundle withwebpackbut the bundle in production mode have no comments and so it's producing a wrong result.petermetz commentedon Sep 11, 2024
@kolserdav You are most welcome! Glad it all worked out in the end!