Skip to content

Commit

Permalink
fix: output.library (#95)
Browse files Browse the repository at this point in the history
Should also accept an array of strings.

Closes #91.
  • Loading branch information
jonathanglasmeyer committed May 20, 2016
1 parent 30e0240 commit d16c417
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/properties/output/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default Joi.object({
jsonpFunction: Joi.string(),
hotUpdateFunction: Joi.string(),
pathinfo: Joi.bool(),
library: notAbsolutePath,
library: [notAbsolutePath, Joi.array().items(Joi.string())],
libraryTarget: Joi.string().valid(['var', 'this', 'commonjs', 'commonjs2', 'amd', 'umd']),
umdNamedDefine: Joi.bool(),
sourcePrefix: Joi.string(),
Expand Down
19 changes: 15 additions & 4 deletions src/properties/output/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ const validModuleConfigs = [
// #12
{ input: { library: 'redux' } },
// #13
{ input: { libraryTarget: 'commonjs' } },
{ input: { library: ['redux', '[name]'] } },
// #14
{ input: { crossOriginLoading: false } },
{ input: { libraryTarget: 'commonjs' } },
// #15
{ input: { crossOriginLoading: 'anonymous' } },
{ input: { crossOriginLoading: false } },
// #16
{ input: { crossOriginLoading: 'anonymous' } },
// #17
{ input: { hashDigestLength: 6 } }, // undocumented
{ input: { crossOriginLoading: 'anonymous' } },
// #18
{ input: { hashDigestLength: 6 } }, // undocumented
// #19
{ input: { publicPath: '' } },
]

Expand Down Expand Up @@ -107,6 +109,15 @@ const invalidModuleConfigs = [
},
error: { message: '"fileName" is not allowed' },
},
// #8
{
input: {
fileName: 'foo',
},
error: { message: '"fileName" is not allowed' },
},
// #9
{ input: { library: ['redux', 1] } },

]

Expand Down

0 comments on commit d16c417

Please sign in to comment.