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

Add quotes to requires #245

Open
DimitryDushkin opened this issue Dec 7, 2016 · 2 comments
Open

Add quotes to requires #245

DimitryDushkin opened this issue Dec 7, 2016 · 2 comments

Comments

@DimitryDushkin
Copy link

DimitryDushkin commented Dec 7, 2016

enb-xjst v.7.3.2

npm i route-parser
// make.js
requires: {
                    'route-parser': {
                        commonJS: 'route-parser'
                    }
}

Causes error, because index.bemhtml.js has following lines (no quotes around route-parser):

"route-parser":[function(require,module,exports){
/**
 * @module Passage
 */
'use strict';

var Route = require('./lib/route');


module.exports = Route;
},{"./lib/route":1}]},{},[]);


    var defineAsGlobal = true;

    // Provide with CommonJS
    if (typeof module === 'object' && typeof module.exports === 'object') {
        exports['BEMHTML'] = buildBemXjst({
    
        
            route-parser: require('route-parser'),
        
    
        
    
}
);
        defineAsGlobal = false;
    }

    // Provide to YModules
    if (typeof modules === 'object') {
        modules.define(
            'BEMHTML',
            [],
            function(
                provide
                
                ) {
                    provide(buildBemXjst({
    
        
            route-parser: require('route-parser'),
        
    
        
    
}
));
                }
            );

        defineAsGlobal = false;
    }

    // Provide to global scope
    if (defineAsGlobal) {
        BEMHTML = buildBemXjst({
    
        
            route-parser: require('route-parser'),
        
    
        
    
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants