Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Undefined site.min when building for production. #13

Closed
dannygarcia opened this Issue · 2 comments

1 participant

@dannygarcia

Running require('project/Site') does not work for built / minified projects when settings.TEMPLATE_DEBUG is false. Specifically, initializing throws the error: Cannot call method 'initialize' of undefined.

Here's an example setup:

<script src="/static/js/libs/require.js"></script>

<script>
    require.config({
        baseUrl : "/static/js",
        paths: {
            "project/Site" : "site.min"
        }
    });
</script>

<script>
    require(["project/Site"], function (site) {
        console.log(site); // undefined
        site.initialize(); // Uncaught TypeError: Cannot call method 'initialize' of undefined
    });
</script>

No other erors. It actually does load the site.min.js file.

@dannygarcia

As a side note: should the require.js script tag be outside the conditional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.