1 | 'use strict';
|
2 |
|
3 | var buble = require('buble');
|
4 | var rollupPluginutils = require('rollup-pluginutils');
|
5 |
|
6 | function buble$1 ( options ) {
|
7 | if ( !options ) options = {};
|
8 | var filter = rollupPluginutils.createFilter( options.include, options.exclude );
|
9 |
|
10 | if ( !options.transforms ) options.transforms = {};
|
11 | options.transforms.modules = false;
|
12 |
|
13 | return {
|
14 | name: 'buble',
|
15 |
|
16 | transform: function ( code, id ) {
|
17 | if ( !filter( id ) ) return null;
|
18 |
|
19 | try {
|
20 | return buble.transform( code, options );
|
21 | } catch (e) {
|
22 | e.plugin = 'buble';
|
23 | if ( !e.loc ) e.loc = {};
|
24 | e.loc.file = id;
|
25 | e.frame = e.snippet;
|
26 | throw e;
|
27 | }
|
28 | }
|
29 | };
|
30 | }
|
31 |
|
32 | module.exports = buble$1;
|