2
votes

i'm trying to use webpack to bundle a bunch of AMD modules.

Before, i used r.js bundler to bundle all my AMD modules in a huge bundle.js.

I used requirejs to get a dependency and using in it my html page:

<script>
    require(["foolib"], function (foolib) {
        foolib.foo();
    });
</script

But with webpack, i failed to reproduce the same behaviour.

The requirejs module loader can work with AMD modules but webpack generates a bundle with a different syntax that i don't understand.

How can i get my "foolib" module to use its functionalities in my page ?

1
Did you try to put all the AMD modules file in the entry as a Array. Like {entry: main:[//you files]}.wuxiandiejia

1 Answers

0
votes

I found a sample project which answers perfectly this question: multi-part-library