Git Product home page Git Product logo

Comments (5)

miffels avatar miffels commented on April 19, 2024

I just played around a bit more and got the following results:

webpack 0.8.x plays nicely with enhanced-require 0.4.x, node-jquery 1.7.x and (jam) jquery 1.7.x. Updating node-jquery to the latest version (1.8.3) did not change anything (i.e. it still built flawlessly). When I did the same with jam's jquery, though, the above errors reoccured (tried 1.9.0pre and 1.8.3). I actually suspected node-jquery to cause the errors, so that outcome sort of surprised me.

from webpack.

sokra avatar sokra commented on April 19, 2024

hmm.. i think the problem is that webpack do not respect the jam section in the package.json

  "jam": {
    "main": "dist/jquery.js",
    "include": ["dist/jquery.js"]
  }

So it tries to load index.js which doesn't exist. So it tries node-jquery with mixed in jam's jquery... fail...

I'll add support for jam.main as packageMains.


jam writes a config for require.js which includes the main field. So require.js would work.

from webpack.

sokra avatar sokra commented on April 19, 2024

So I added jam.main to the defaults for packageMains.

Your example will build now:

Hash: 434aa3aa5292c1b194270b7b7657b191
Compile Time: 554ms
Chunks: 1
Modules: 7
Modules including duplicates: 7
Modules first chunk: 7
main   bundle.js:   272884 chars/bytes

 <id>    <size>  <filename>
bundle.js
    0       134  .\main.js
    1       445  (webpack)\buildin\__webpack_amd_require.js
    2       552  (webpack)\buildin\__webpack_amd_define.js
    3       251  (webpack)\buildin\__webpack_module.js
    4        24  (webpack)\buildin\__webpack_options_amd.loader.js!(webpack)\buildin\__webpack_options_amd.loader.js
    5       151  (webpack)\~\enhanced-require\lib\require.webpack.js
    6    269754  .\web_modules\jquery\dist\jquery.js

from webpack.

miffels avatar miffels commented on April 19, 2024

Hi sokra,

I just tried it in one of my projects and can confirm this works flawlessly. Thank you very much!

Best regards,
miffels

from webpack.

sokra avatar sokra commented on April 19, 2024

😄

from webpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.