mirror of https://github.com/lukechilds/rollup.git
Rich-Harris
8 years ago
22 changed files with 104 additions and 21 deletions
@ -1,9 +1,7 @@ |
|||
import external from 'external'; |
|||
import a from 'other'; |
|||
import { b } from 'other'; |
|||
import { another } from 'another'; |
|||
import { name } from 'other'; |
|||
import * as namespace from './namespace.js'; |
|||
|
|||
console.log( Object.keys( namespace ) ); |
|||
console.log( name ); |
|||
|
|||
export default 42; |
|||
|
@ -0,0 +1,5 @@ |
|||
const assert = require( 'assert' ); |
|||
|
|||
module.exports = { |
|||
description: 'excludes unused imports ([#595])' |
|||
}; |
@ -0,0 +1,5 @@ |
|||
define(['external'], function (external) { 'use strict'; |
|||
|
|||
|
|||
|
|||
}); |
@ -0,0 +1,3 @@ |
|||
'use strict'; |
|||
|
|||
require('external'); |
@ -0,0 +1 @@ |
|||
import 'external'; |
@ -0,0 +1,6 @@ |
|||
(function (external) { |
|||
'use strict'; |
|||
|
|||
|
|||
|
|||
}(external)); |
@ -0,0 +1,9 @@ |
|||
(function (global, factory) { |
|||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('external')) : |
|||
typeof define === 'function' && define.amd ? define(['external'], factory) : |
|||
(factory(global.external)); |
|||
}(this, (function (external) { 'use strict'; |
|||
|
|||
|
|||
|
|||
}))); |
@ -0,0 +1,5 @@ |
|||
import { unused } from 'external'; |
|||
|
|||
function alsoUnused () { |
|||
unused(); |
|||
} |
@ -1,5 +1,6 @@ |
|||
import { basename } from 'path'; |
|||
|
|||
var x = function basename () {}; |
|||
var y = basename( 'path/to/somefile.txt' ); |
|||
|
|||
export { x }; |
|||
export { x, y }; |
|||
|
@ -0,0 +1,12 @@ |
|||
const assert = require( 'assert' ); |
|||
|
|||
module.exports = { |
|||
description: 'warns on unused imports ([#595])', |
|||
warnings: warnings => { |
|||
assert.deepEqual( warnings, [ |
|||
`Treating 'external' as external dependency`, |
|||
`'unused', 'notused' and 'neverused' are imported from external module 'external' but never used`, |
|||
`Generated an empty bundle` |
|||
]); |
|||
} |
|||
}; |
@ -0,0 +1,5 @@ |
|||
import { unused, notused, neverused as willnotuse } from 'external'; |
|||
|
|||
function alsoUnused () { |
|||
unused(); |
|||
} |
Loading…
Reference in new issue