0

When executing the optimize statement:

r.js -o app.build.js

Optimize command throws an error:

Error: ENOENT, no such file or directory '[...]/js/customizer-build/marionette.js'

app.build.js

({
    appDir: "./",
    baseUrl: "./",
    dir: "../customizer-build",
    modules: [
        {
            name: "main"
        }
    ]
})

Marionette is specified as a module in my require.config of main.js:

require.config({
    shim: {
    //....
        marionette: {
            deps: [
                'backbone'
            ],
            exports: 'Marionette'
        },
    //....

    paths: {
    //....
        marionette: '/js/lib/marionette/lib/backbone.marionette.min',
    //....
    }
});

1 Answer 1

1

Put a mainConfigFile option set to point to main.js in your app.build.js file. Without it, the optimizer ignores the configuration in main.js.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! This helped clear the error for Marionette, but other libs are choking now - Error: ENOENT, no such file or directory /js/lib/lodash/dist/lodash.min.js // I'm starting to wonder if it was right to build the app with paths as absolute from htdoc root?
With what is present in the question at the moment, it is hard to tell what other things may be wrong. Absolute paths can make things difficult. I prefer not to use them if I can.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.