Skip to content

Commit d16c417

Browse files
fix: output.library (#95)
Should also accept an array of strings. Closes #91.
1 parent 30e0240 commit d16c417

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/properties/output/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default Joi.object({
1919
jsonpFunction: Joi.string(),
2020
hotUpdateFunction: Joi.string(),
2121
pathinfo: Joi.bool(),
22-
library: notAbsolutePath,
22+
library: [notAbsolutePath, Joi.array().items(Joi.string())],
2323
libraryTarget: Joi.string().valid(['var', 'this', 'commonjs', 'commonjs2', 'amd', 'umd']),
2424
umdNamedDefine: Joi.bool(),
2525
sourcePrefix: Joi.string(),

src/properties/output/index.test.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@ const validModuleConfigs = [
3030
// #12
3131
{ input: { library: 'redux' } },
3232
// #13
33-
{ input: { libraryTarget: 'commonjs' } },
33+
{ input: { library: ['redux', '[name]'] } },
3434
// #14
35-
{ input: { crossOriginLoading: false } },
35+
{ input: { libraryTarget: 'commonjs' } },
3636
// #15
37-
{ input: { crossOriginLoading: 'anonymous' } },
37+
{ input: { crossOriginLoading: false } },
3838
// #16
3939
{ input: { crossOriginLoading: 'anonymous' } },
4040
// #17
41-
{ input: { hashDigestLength: 6 } }, // undocumented
41+
{ input: { crossOriginLoading: 'anonymous' } },
4242
// #18
43+
{ input: { hashDigestLength: 6 } }, // undocumented
44+
// #19
4345
{ input: { publicPath: '' } },
4446
]
4547

@@ -107,6 +109,15 @@ const invalidModuleConfigs = [
107109
},
108110
error: { message: '"fileName" is not allowed' },
109111
},
112+
// #8
113+
{
114+
input: {
115+
fileName: 'foo',
116+
},
117+
error: { message: '"fileName" is not allowed' },
118+
},
119+
// #9
120+
{ input: { library: ['redux', 1] } },
110121

111122
]
112123

0 commit comments

Comments
 (0)