Skip to content

Commit 1f6431e

Browse files
committed
refactor(ES6): changed lengthy error message string to template literal
1 parent 29bf3e7 commit 1f6431e

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

‎lib/optimize/CommonsChunkPlugin.js‎

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@ let nextIdent = 0;
88
class CommonsChunkPlugin {
99
constructor(options) {
1010
if(arguments.length > 1) {
11-
throw new Error("Deprecation notice: CommonsChunkPlugin now only takes a single argument. Either an options " +
12-
"object *or* the name of the chunk.\n" +
13-
"Example: if your old code looked like this:\n" +
14-
" new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js')\n\n" +
15-
"You would change it to:\n" +
16-
" new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.bundle.js' })\n\n" +
17-
"The available options are:\n" +
18-
" name: string\n" +
19-
" names: string[]\n" +
20-
" filename: string\n" +
21-
" minChunks: number\n" +
22-
" chunks: string[]\n" +
23-
" children: boolean\n" +
24-
" async: boolean\n" +
25-
" minSize: number\n");
11+
throw new Error(`Deprecation notice: CommonsChunkPlugin now only takes a single argument. Either an options
12+
object *or* the name of the chunk.
13+
Example: if your old code looked like this:
14+
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js')
15+
16+
You would change it to:
17+
new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.bundle.js' })
18+
19+
The available options are:
20+
name: string
21+
names: string[]
22+
filename: string
23+
minChunks: number
24+
chunks: string[]
25+
children: boolean
26+
async: boolean
27+
minSize: number`);
2628
}
2729
if(Array.isArray(options) || typeof options === "string") {
2830
options = {

0 commit comments

Comments
 (0)