File tree 3 files changed +13
-8
lines changed
3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 14
14
],
15
15
"scripts" : {
16
16
"build" : " npm run -s build:babel && npm run -s build:self && npm run build:types" ,
17
- "build:babel" : " babel-node --extensions \" .ts\" src/cli.ts \" src/{cli,index}.ts\" --target=8 --output=dist" ,
18
- "build:self" : " node dist/cli.js \" src/{cli,index}.ts\" --target=8 --output=dist" ,
17
+ "build:babel" : " babel-node --extensions \" .ts\" src/cli.ts \" src/{cli,index}.ts\" --target=8 --output=dist --compress " ,
18
+ "build:self" : " node dist/cli.js \" src/{cli,index}.ts\" --target=8 --output=dist --compress " ,
19
19
"build:types" : " tsc --emitDeclarationOnly --outdir types --declaration --allowSyntheticDefaultImports src/{cli,index}.ts" ,
20
20
"test" : " echo \" Error: no test specified\" && exit 1"
21
21
},
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const mriConfig = {
10
10
boolean : [ 'compress' ] ,
11
11
default : {
12
12
compress : false ,
13
- output : 'lib ' ,
13
+ output : 'dist ' ,
14
14
} ,
15
15
} ;
16
16
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ async function createRollupConfig({
44
44
45
45
let banner = '' ;
46
46
47
+ const externalTest = new RegExp ( `^(${ external . join ( '|' ) } )($|/)` ) ;
48
+
47
49
const inputOptions : InputOptions = {
48
50
input,
49
51
external : id => {
@@ -52,7 +54,8 @@ async function createRollupConfig({
52
54
return true ;
53
55
}
54
56
55
- return external . includes ( id ) ;
57
+ // otherwise do what you'd normally expect for exclusion
58
+ return externalTest . test ( id ) ;
56
59
} ,
57
60
plugins : [
58
61
{
@@ -134,18 +137,20 @@ export async function bundler({
134
137
135
138
const pkg = await getConfig ( cwd ) ;
136
139
137
- const externalDependencies = Object . keys ( pkg . dependencies || { } ) ;
140
+ const pkgDependencies = Object . keys ( pkg . dependencies || { } ) ;
138
141
139
142
const inputs = await glob ( input , { absolute : true } ) ;
140
143
141
144
for ( let idx = 0 ; idx < inputs . length ; idx ++ ) {
142
145
const input = inputs [ idx ] ;
143
146
147
+ const externalDependencies = pkgDependencies . concat (
148
+ inputs . filter ( e => e !== input )
149
+ ) ;
150
+
144
151
const { inputOptions, outputOptions } = await createRollupConfig ( {
145
152
compress,
146
- externalDependencies : externalDependencies . concat (
147
- inputs . filter ( e => e !== input )
148
- ) ,
153
+ externalDependencies,
149
154
input,
150
155
nodeTarget,
151
156
outputDir,
You can’t perform that action at this time.
0 commit comments