Skip to content

Commit 46c99a0

Browse files
nlarcheKent C. Dodds
authored andcommitted
fix(devtool): devtool validation too lenient (#94)
* fix: output.publicPath validation is too strict closes #88 * fix: devtool validation is too lenient closes #86 * Revert "fix: output.publicPath validation is too strict" This reverts commit da793cb.
1 parent 7881ccb commit 46c99a0

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/properties/devtool/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const options = [
1515
const DEVTOOL_REGEX = new RegExp(
1616
'^' + // start of string
1717
'(#@|@|#)?' + // maybe one of the pragmas
18-
`(${options.join('|')})` // one of the options
18+
`(${options.join('$|')})` // one of the options
1919
)
2020

2121
export default Joi

src/properties/devtool/index.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@ const validModuleConfigs = [
66
'eval',
77
'#@eval',
88
'#cheap-module-eval-source-map',
9+
'hidden-source-map',
10+
'inline-source-map',
11+
'eval-source-map',
12+
'cheap-source-map',
913
]
1014

1115
const invalidModuleConfigs = [
1216
// #0
1317
{ input: 'foo', error: { } },
18+
// #1
19+
{ input: 'eval-source-map-foo', error: { } },
20+
// #2
21+
{ input: 'foo-cheap-source-map', error: { } },
22+
// #3
23+
{ input: '#@eval-foo', error: { } },
1424
]
1525

1626
describe('devtool', () => {

0 commit comments

Comments
 (0)