mirror of https://github.com/lukechilds/rollup.git
8 changed files with 62 additions and 0 deletions
@ -0,0 +1,6 @@ |
|||||
|
module.exports = { |
||||
|
description: 'handles external aliased named imports that shadow another name', |
||||
|
options: { |
||||
|
external: [ 'acorn' ] |
||||
|
} |
||||
|
}; |
@ -0,0 +1,9 @@ |
|||||
|
define(['acorn'], function (acorn) { 'use strict'; |
||||
|
|
||||
|
function parse(source) { |
||||
|
return acorn.parse(source, { ecmaVersion: 6 }); |
||||
|
} |
||||
|
|
||||
|
console.log(parse('foo')); |
||||
|
|
||||
|
}); |
@ -0,0 +1,9 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
var acorn = require('acorn'); |
||||
|
|
||||
|
function parse(source) { |
||||
|
return acorn.parse(source, { ecmaVersion: 6 }); |
||||
|
} |
||||
|
|
||||
|
console.log(parse('foo')); |
@ -0,0 +1,7 @@ |
|||||
|
import { parse } from 'acorn'; |
||||
|
|
||||
|
function parse$$(source) { |
||||
|
return parse(source, { ecmaVersion: 6 }); |
||||
|
} |
||||
|
|
||||
|
console.log(parse$$('foo')); |
@ -0,0 +1,10 @@ |
|||||
|
(function (acorn) { |
||||
|
'use strict'; |
||||
|
|
||||
|
function parse(source) { |
||||
|
return acorn.parse(source, { ecmaVersion: 6 }); |
||||
|
} |
||||
|
|
||||
|
console.log(parse('foo')); |
||||
|
|
||||
|
}(acorn)); |
@ -0,0 +1,13 @@ |
|||||
|
(function (global, factory) { |
||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('acorn')) : |
||||
|
typeof define === 'function' && define.amd ? define(['acorn'], factory) : |
||||
|
(factory(global.acorn)); |
||||
|
}(this, function (acorn) { 'use strict'; |
||||
|
|
||||
|
function parse(source) { |
||||
|
return acorn.parse(source, { ecmaVersion: 6 }); |
||||
|
} |
||||
|
|
||||
|
console.log(parse('foo')); |
||||
|
|
||||
|
})); |
@ -0,0 +1,3 @@ |
|||||
|
import parse from './parse'; |
||||
|
|
||||
|
console.log(parse('foo')); |
@ -0,0 +1,5 @@ |
|||||
|
import { parse as acornParse } from 'acorn'; |
||||
|
|
||||
|
export default function parse(source) { |
||||
|
return acornParse(source, { ecmaVersion: 6 }); |
||||
|
} |
Loading…
Reference in new issue