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;








0















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.










share|improve this question






























    0















    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.










    share|improve this question


























      0












      0








      0








      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 23 at 3:37







      Freewind

















      asked Mar 22 at 17:13









      FreewindFreewind

      78.9k116319571




      78.9k116319571






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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.






          share|improve this answer























            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
            );



            );













            draft saved

            draft discarded


















            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









            0














            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.






            share|improve this answer



























              0














              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.






              share|improve this answer

























                0












                0








                0







                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.






                share|improve this answer













                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 23 at 3:36









                FreewindFreewind

                78.9k116319571




                78.9k116319571





























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현