Is it possible to use two .babelrc files?

Maffelu

I have a project that runs both a build using rollup and a build using browserify for two different outputs. Now, they are both located in the same root dir and I have separate gulp-tasks running for both of them. My problem is that my browserify task wants a .babelrc file with the following configuration:

{
  "presets": ["es2015"]
}

and my rollup task wants this configuration:

{
  "presets": ["es2015-rollup"]
}

My question is, can I have two separate .babelrc files and configure which one to use in my gulp and karma config?

Maffelu

I looked around a lot before asking this question and right after I posted I found a possible solution:

gulp.task('rollup', () => {
  return gulp.src('src/server/index.js', { read: false })
    .pipe(rollup({
      plugins: [babel({
        presets: ["es2015-rollup"],
        babelrc: false
      })]
    }))
    .pipe(gulp.dest('public/'));
});

By configuring one of the tasks to not use the babelrc I could of course configure it myself directly. This isn't a great answer and I would've preferred to just added the name of a babelrc file.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Use .babelrc from different path

From Dev

Is it possible to use two keyboards simultaneously?

From Dev

Is it possible to use two subclasses of PFUser?

From Dev

How to use babel6 with .babelrc

From Dev

Is it possible to use to use two wifi connections in Ubuntu?

From Dev

Is it possible to view two files simultaneously in Geany?

From Dev

Is it possible to list the files between two names alphanumerically?

From Dev

Is it possible to use the meta-files in rtorrent?

From Dev

Is it possible to use matlab MEX files outside matlab?

From Dev

Possible to use .zip file with multiple .csv files?

From Dev

Whether it is possible to use two activities with same layout

From Dev

R: possible to use function with two arguments for Map?

From Dev

UML Is it possible to use Aggregation and Composition with two classes?

From Dev

Is is possible to use two kernels at the same time?

From Dev

Is it possible to use two different configs for the same context

From Dev

Is it possible to use two record helpers for the string type?

From Dev

Is is possible to use two kernels at the same time?

From Dev

Is it possible to use one InputBox for two functions?

From Dev

How to pass two presets arguments to babel without using .babelrc file?

From Dev

Can I use "git checkout --" on two files?

From Dev

Can two torrent files use the same source?

From Dev

How to use shell parallel with two files

From Dev

How to use Java to compare two csv files?

From Dev

Print and use the data from two files simultaenously

From Dev

Is it possible to use Dojo webjars SourceMaps to use Uncompressed Files?

From Dev

Is it possible to merge two google cloud storage files into one

From Dev

Batch - Output all possible combinations of strings in two files

From Dev

is it possible to easily merge two files like this in Sublime Text 2?

From Dev

Is it possible to add two links/files in a single import in CSS?

Related Related

  1. 1

    Use .babelrc from different path

  2. 2

    Is it possible to use two keyboards simultaneously?

  3. 3

    Is it possible to use two subclasses of PFUser?

  4. 4

    How to use babel6 with .babelrc

  5. 5

    Is it possible to use to use two wifi connections in Ubuntu?

  6. 6

    Is it possible to view two files simultaneously in Geany?

  7. 7

    Is it possible to list the files between two names alphanumerically?

  8. 8

    Is it possible to use the meta-files in rtorrent?

  9. 9

    Is it possible to use matlab MEX files outside matlab?

  10. 10

    Possible to use .zip file with multiple .csv files?

  11. 11

    Whether it is possible to use two activities with same layout

  12. 12

    R: possible to use function with two arguments for Map?

  13. 13

    UML Is it possible to use Aggregation and Composition with two classes?

  14. 14

    Is is possible to use two kernels at the same time?

  15. 15

    Is it possible to use two different configs for the same context

  16. 16

    Is it possible to use two record helpers for the string type?

  17. 17

    Is is possible to use two kernels at the same time?

  18. 18

    Is it possible to use one InputBox for two functions?

  19. 19

    How to pass two presets arguments to babel without using .babelrc file?

  20. 20

    Can I use "git checkout --" on two files?

  21. 21

    Can two torrent files use the same source?

  22. 22

    How to use shell parallel with two files

  23. 23

    How to use Java to compare two csv files?

  24. 24

    Print and use the data from two files simultaenously

  25. 25

    Is it possible to use Dojo webjars SourceMaps to use Uncompressed Files?

  26. 26

    Is it possible to merge two google cloud storage files into one

  27. 27

    Batch - Output all possible combinations of strings in two files

  28. 28

    is it possible to easily merge two files like this in Sublime Text 2?

  29. 29

    Is it possible to add two links/files in a single import in CSS?

HotTag

Archive