requirejs-rails icon indicating copy to clipboard operation
requirejs-rails copied to clipboard

requirejs precompile not supported with es6 files from sprockets-es6 gem

Open chenxeed opened this issue 9 years ago • 6 comments

Hi.

I installed both sprockets-es6 and requirejs-rails in my Rails app.

I changed some of my javascript files to *.es6 extension so that Rails asset pipeline can compile those files to *.es5 from gem sprockets-es6.

Those files also loads normally on requirejs-rails development mode, but unfortunately it returns error on precompiling. The error is something like this:

{ [Error: Error: ENOENT, no such file or directory '/home/chenx/Projects/piktov2-rails/tmp/requirejs/dst/view/templates.js'
In module tree:
    controller/templates

    at Object.fs.openSync (fs.js:432:18)
]
  originalError: 
   { [Error: ENOENT, no such file or directory '/home/chenx/Projects/piktov2-rails/tmp/requirejs/dst/view/templates.js']
     errno: 34,
     code: 'ENOENT',
     path: '/home/chenx/Projects/piktov2-rails/tmp/requirejs/dst/view/templates.js',
     syscall: 'open',
     fileName: '/home/chenx/Projects/piktov2-rails/tmp/requirejs/dst/view/templates.js',
     moduleTree: [ 'controller/templates' ] } }

The file can't be found because it is already named as .es6, hence: /view/templates.es6 and precompiler can't find it.

Need any assistance or suggestions here to support both gems. Thank you :)

chenxeed avatar Jul 03 '15 07:07 chenxeed