javascript - Babel keeps building the wrong module format, what am I missing? -


i need build library:

https://github.com/milworm/gulp-css-gsub

so output created under lib folder have module format this:

exports["default"] = function (config) {    ... }  module.exports = exports["default"]; 

but keep getting output:

export default (config => {    ... } 

i'm building using babel. started running npm install, , library includes both gulp babel , es2015 preset on dev dependencies in package.json:

"babel-preset-es2015": "^6.5.0", "gulp-babel": "^6.1.2", 

...then tried this:

1 - created .babelrc file @ root of dir i'm building content:

{ "presets": ["es2015"] } 

...then ran command babel -d lib/ src/ - got same output.

2 - created gulp file run babel looks this:

gulp.task('build', () => {         return gulp.src('src/*')             .pipe(babel({                 presets: ['es2015']             }))             .pipe(gulp.dest('lib')); }); 

but got same output.

my goal build using gulp file, , first module format.

what missing?


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -