mochiscript icon indicating copy to clipboard operation
mochiscript copied to clipboard

Other nodejs modules compatibility

Open ijames07 opened this issue 11 years ago • 0 comments

Hi, is possible to write in mochiscript and at the same time use another nodejs modules and then get this code working in browser? If I compile *.ms files in ms-compile, then I don't have access to "require" from nodejs. And when I try to use browserify (https://github.com/substack/node-browserify) to pass "require problem", then browserify throws error

Unexpected identifier at: 
export class MyClass { 
    function initialize(args){

    }

So I tried to compile MyClass.ms file, open compiled MyClass.js file and copy content from mochiscript.js, which is used to get work compiled *.js files in browser, then use browserify. Browserify finishes successfully, but loaded page in browser throws error

Uncaught reference error: root is not defined

in code

var $m = {
  ROOT: root,

So can I use mochiscript with other node.js modules in browser? How can I get it working?

ijames07 avatar Jun 25 '14 12:06 ijames07