Skip to content
This repository has been archived by the owner on Dec 12, 2017. It is now read-only.

Commit

Permalink
cooking: fix cooking#set
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Sep 11, 2016
1 parent 5b0656d commit e4f9e17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cooking/lib/cooking.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const replacePath = function (_path) {
}

if (/^(plugin)s?/g.test(_path)) {
return _path.replace(/^(plugin)s?/g, 'module.$1s')
return _path.replace(/^(plugin)s?/g, '$1s')
}

return _path
Expand Down
2 changes: 2 additions & 0 deletions test/cooking.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,11 @@ test('add method', t => {
cooking.set({})
cooking.add('loader.mp4', loaderMP4Config)
cooking.add('loader.json', loaderJSONConfig)
cooking.add('plugins.abc', 1)

t.deepEqual(cooking.config.module.loaders.mp4, loaderMP4Config)
t.deepEqual(cooking.config.module.loaders.json, loaderJSONConfig)
t.deepEqual(cooking.config.plugins.abc, 1)
})

test('remove method', t => {
Expand Down

0 comments on commit e4f9e17

Please sign in to comment.