File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 "cover:test" : " nyc --reporter=lcov --reporter=text npm test" ,
2424 "cover:report" : " npm-if TRAVIS \" codeclimate-test-reporter < coverage/lcov.info\" " ,
2525 "lint" : " eslint src test" ,
26- "version" : " node changelog.js > CHANGELOG.md && git add CHANGELOG.md" ,
27- "postversion" : " git push --follow-tags" ,
26+ "postversion" : " node changelog.js > CHANGELOG.md && git add CHANGELOG.md && echo ':wq' | git commit --amend && git push --follow-tags" ,
2827 "build" : " abby compile --log --env"
2928 },
3029 "nyc" : {
4039 }
4140 },
4241 "dependencies" : {
43- "babel-template" : " ^6.5.0" ,
44- "lodash.get" : " ^4.2.1"
42+ "babel-template" : " ^6.5.0"
4543 },
4644 "devDependencies" : {
4745 "abigail" : " ^1.6.1" ,
Original file line number Diff line number Diff line change 11import babelTemplate from 'babel-template'
2- import _get from 'lodash.get'
32
4- export default {
3+ module . exports = {
54 visitor : {
65 Program : {
76 exit ( path ) {
@@ -18,7 +17,7 @@ export default {
1817 }
1918 if ( path . isExportNamedDeclaration ( ) ) {
2019 // HACK detect export-from statements for default
21- const specifiers = _get ( path . get ( 'declaration' ) , ' container.specifiers' )
20+ const specifiers = path . get ( 'declaration' ) . container . specifiers
2221 const isDefaultExportDeclaration = specifiers . length === 1 && specifiers [ 0 ] . exported . name === 'default'
2322 if ( isDefaultExportDeclaration ) {
2423 hasExportDefault = true
Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ describe('babel-plugin-add-module-exports', () => {
1111 assert ( module . default === 'default-entry' )
1212 } ) )
1313
14+ it ( 'plugin should export to module.exports(#31)' , ( ) => {
15+ const plugin = require ( '../lib' )
16+ assert ( typeof plugin === 'object' )
17+ assert ( typeof plugin . visitor === 'object' )
18+ } )
19+
1420 it ( 'should handle duplicated plugin references (#1)' , ( ) =>
1521 heplers . testPlugin ( testCases [ 0 ] . code , {
1622 presets : [ 'es2015' ] ,
You can’t perform that action at this time.
0 commit comments