Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"modules" property #8

Open
ORESoftware opened this issue Jan 25, 2017 · 1 comment
Open

"modules" property #8

ORESoftware opened this issue Jan 25, 2017 · 1 comment

Comments

@ORESoftware
Copy link

ORESoftware commented Jan 25, 2017

@jrburke

to this day, I still don't understand what the "modules" property does here:

https://github.com/volojs/create-template/blob/master/tools/build.js

what is the difference between modules produced by the optimizer and bundles produced by the optimizer?

@ORESoftware
Copy link
Author

ORESoftware commented Jan 25, 2017

I did my HW and cloned the repo and ran the optimizer, it produces this for app.js in the www-built dir:

define("app/messages", [], function () {
    return {
        getHello: function () {
            return "Hello World"
        }
    }
}), define("print", [], function () {
    return function (e) {
        console.log(e)
    }
}), define("app/main", ["require", "./messages", "print"], function (e) {
    var n = e("./messages"), i = e("print");
    i(n.getHello())
}), requirejs.config({baseUrl: "lib", paths: {app: "../app"}}), requirejs(["app/main"]), 
    
    define("app", function () {
});

I love it, it's dead f-ing simple. But what I don't understand is - what is the empty app modules for:

    define("app", function () {
    });

that makes no sense to have that

and I still don't know what the modules property does vs. bundles. TMK bundles is a newer feature than modules but I am not even sure if they are comparable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant