@bmurphy wrote:
Hello everyone,
I need some guidance on how to proceed with a build issue in my project. I've got a dependency not getting transpiled to ES5 when I build. The particular situation is I'm using the addon Ember-Browserify to import the npm package probe-image-size into a component which works as expected. The issue is one of the dependencies of that package, namely get-stream, is written as a CJS module with ES6 syntax which does not get transpiled to ES5 code in my vendor.js file.
So with that a few things:
- I tried using the transform babelify with the presets babel-preset-es2015 to target the get-stream package specifically but without success. Not sure if it's the right thing to do.
module.exports = function(environment) { var ENV = { ... browserify: { transform: ['babelify', { global: true, presets: ['es2015'], only: /\/node_modules\/get-stream/ }] } } }
Building produces a "ENOTEMPTY: Directory not empty, rmdir ..." error on the projects tmp/ directory.
- I thought that maybe I could manually use the broccoli-babel-transpiler in order to transpile the files needed myself and include them in the build tree. I'm having trouble understanding how to go about doing so though.
So far I'm just kinda struggling to get my head wrapped around the entire Broccoli pipline and how I might use it to solve this problem. The only solution I can think of for the time being is to manually use Browserify to transpile the entire probe-image-size package and its dependencies and just stick them in my vendor directory just so I can move forward.
Any insight is greatly appreciated.
Cheers!
Posts: 1
Participants: 1