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