Webpack doesn't work with 'module' field of in-direct dependenciesManaging jQuery plugin dependency in webpackWebpack - entry point common dependenciesWebpack 2: cannot resolve moduleWebpack: way to override ignored modules in package.json browser field?Field 'browser' doesn't contain a valid alias configurationWebpack 2 won't work when using ts-loaderImport angularjs modules with webpackwebpack bundled module is undefined when required by node`import username from './username.txt'` with typescript+webpack gives `undefined`efficient import export of modules with webpack and babel-loader - tree shaking not working
Classification of surfaces
Aligning equation numbers vertically
How much cash can I safely carry into the USA and avoid civil forfeiture?
A strange hotel
What is the most expensive material in the world that could be used to create Pun-Pun's lute?
Extension of 2-adic valuation to the real numbers
How to stop co-workers from teasing me because I know Russian?
What term is being referred to with "reflected-sound-of-underground-spirits"?
"The cow" OR "a cow" OR "cows" in this context
How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?
How to write a column outside the braces in a matrix?
Do I have an "anti-research" personality?
Contradiction proof for inequality of P and NP?
Why did C use the -> operator instead of reusing the . operator?
How to denote matrix elements succinctly?
Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?
Critique of timeline aesthetic
Re-entry to Germany after vacation using blue card
Should the Death Curse affect an undead PC in the Tomb of Annihilation adventure?
Was there a shared-world project before "Thieves World"?
bldc motor, esc and battery draw, nominal vs peak
How can I practically buy stocks?
Why does nature favour the Laplacian?
What does ゆーか mean?
Webpack doesn't work with 'module' field of in-direct dependencies
Managing jQuery plugin dependency in webpackWebpack - entry point common dependenciesWebpack 2: cannot resolve moduleWebpack: way to override ignored modules in package.json browser field?Field 'browser' doesn't contain a valid alias configurationWebpack 2 won't work when using ts-loaderImport angularjs modules with webpackwebpack bundled module is undefined when required by node`import username from './username.txt'` with typescript+webpack gives `undefined`efficient import export of modules with webpack and babel-loader - tree shaking not working
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have two modules which have only module
field (points to an esm
bundle file) in their package.json
, and have no main
field.
module2
uses module1
, and I also created a demo project uses module2
.
Since they both have module
field, I specify the resolve.mainFields
in the webpack config file in the demo project:
resolve:
mainFields: ['module']
but when I run webpack
in the demo project, only module2
is resolved correctly, and webpack can't find the bundle file of module1
.
I created a demo project with complete code for this issue, please see:
https://github.com/freewind-demos/typescript-webpack-uses-esm-modules-demo/tree/issue
Hope to know where is wrong and make them work, thanks.
webpack module
add a comment |
I have two modules which have only module
field (points to an esm
bundle file) in their package.json
, and have no main
field.
module2
uses module1
, and I also created a demo project uses module2
.
Since they both have module
field, I specify the resolve.mainFields
in the webpack config file in the demo project:
resolve:
mainFields: ['module']
but when I run webpack
in the demo project, only module2
is resolved correctly, and webpack can't find the bundle file of module1
.
I created a demo project with complete code for this issue, please see:
https://github.com/freewind-demos/typescript-webpack-uses-esm-modules-demo/tree/issue
Hope to know where is wrong and make them work, thanks.
webpack module
add a comment |
I have two modules which have only module
field (points to an esm
bundle file) in their package.json
, and have no main
field.
module2
uses module1
, and I also created a demo project uses module2
.
Since they both have module
field, I specify the resolve.mainFields
in the webpack config file in the demo project:
resolve:
mainFields: ['module']
but when I run webpack
in the demo project, only module2
is resolved correctly, and webpack can't find the bundle file of module1
.
I created a demo project with complete code for this issue, please see:
https://github.com/freewind-demos/typescript-webpack-uses-esm-modules-demo/tree/issue
Hope to know where is wrong and make them work, thanks.
webpack module
I have two modules which have only module
field (points to an esm
bundle file) in their package.json
, and have no main
field.
module2
uses module1
, and I also created a demo project uses module2
.
Since they both have module
field, I specify the resolve.mainFields
in the webpack config file in the demo project:
resolve:
mainFields: ['module']
but when I run webpack
in the demo project, only module2
is resolved correctly, and webpack can't find the bundle file of module1
.
I created a demo project with complete code for this issue, please see:
https://github.com/freewind-demos/typescript-webpack-uses-esm-modules-demo/tree/issue
Hope to know where is wrong and make them work, thanks.
webpack module
webpack module
edited Mar 23 at 3:37
Freewind
asked Mar 22 at 17:13
FreewindFreewind
78.9k116319571
78.9k116319571
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Finally I found the problem is the file name. The bundle name was .mjs
, and I changed it to .something.js
, it's OK now.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55304711%2fwebpack-doesnt-work-with-module-field-of-in-direct-dependencies%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Finally I found the problem is the file name. The bundle name was .mjs
, and I changed it to .something.js
, it's OK now.
add a comment |
Finally I found the problem is the file name. The bundle name was .mjs
, and I changed it to .something.js
, it's OK now.
add a comment |
Finally I found the problem is the file name. The bundle name was .mjs
, and I changed it to .something.js
, it's OK now.
Finally I found the problem is the file name. The bundle name was .mjs
, and I changed it to .something.js
, it's OK now.
answered Mar 23 at 3:36
FreewindFreewind
78.9k116319571
78.9k116319571
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55304711%2fwebpack-doesnt-work-with-module-field-of-in-direct-dependencies%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown