diff --git a/bin/config-yargs.js b/bin/config-yargs.js index 5f112db0dfb..a02c774d0d7 100644 --- a/bin/config-yargs.js +++ b/bin/config-yargs.js @@ -137,7 +137,7 @@ module.exports = function(yargs) { group: OUTPUT_GROUP }, "output-library": { - type: "array", + type: "string", describe: "Expose the exports of the entry point as library", group: OUTPUT_GROUP, requiresArg: true diff --git a/bin/convert-argv.js b/bin/convert-argv.js index b523ad98d05..82fe87a410e 100644 --- a/bin/convert-argv.js +++ b/bin/convert-argv.js @@ -441,10 +441,7 @@ module.exports = function(...args) { ifArg("output-library", function(value) { ensureObject(options, "output"); - if (!options.output.library) { - options.output.library = []; - } - options.output.library.push(value); + options.output.library = value; }); ifArg("output-library-target", function(value) { diff --git a/test/binCases/output/output-library-many/index.js b/test/binCases/output/output-library-many/index.js deleted file mode 100644 index 0d24e266fe2..00000000000 --- a/test/binCases/output/output-library-many/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "index"; diff --git a/test/binCases/output/output-library-many/stdin.js b/test/binCases/output/output-library-many/stdin.js deleted file mode 100644 index df5425b6d06..00000000000 --- a/test/binCases/output/output-library-many/stdin.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -module.exports = function testAssertions(code, stdout, stderr) { - expect(code).toBe(0); - expect(stdout).toEqual(expect.anything()); - expect(stdout[5]).toContain("bundle.js"); - expect(stdout[7]).toMatch(/index\.js.*\{0\}/); - expect(stderr).toHaveLength(0); - - const output = require("fs").readFileSync(require("path").join(__dirname, "../../../js/bin/output/output-library-many/bundle.js"), "utf-8"); - expect(output).toContain("window.key1=window.key1||{},window.key1.key2=function"); -}; diff --git a/test/binCases/output/output-library-many/test.opts b/test/binCases/output/output-library-many/test.opts deleted file mode 100644 index 9dc11f5ca63..00000000000 --- a/test/binCases/output/output-library-many/test.opts +++ /dev/null @@ -1,5 +0,0 @@ -./index.js --o ../../../js/bin/output/output-library-many/bundle.js ---target async-node ---output-library-target window ---output-library key1 --output-library key2 diff --git a/test/binCases/output/output-library-single/index.js b/test/binCases/output/output-library-single/index.js deleted file mode 100644 index 0d24e266fe2..00000000000 --- a/test/binCases/output/output-library-single/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "index"; diff --git a/test/binCases/output/output-library-single/stdin.js b/test/binCases/output/output-library-single/stdin.js deleted file mode 100644 index 1c3a14167fc..00000000000 --- a/test/binCases/output/output-library-single/stdin.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -module.exports = function testAssertions(code, stdout, stderr) { - expect(code).toBe(0); - expect(stdout).toEqual(expect.anything()); - expect(stdout[5]).toContain("bundle.js"); - expect(stdout[7]).toMatch(/index\.js.*\{0\}/); - expect(stderr).toHaveLength(0); - - const output = require("fs").readFileSync(require("path").join(__dirname, "../../../js/bin/output/output-library-single/bundle.js"), "utf-8"); - expect(output).toContain("window.key1=function"); -}; diff --git a/test/binCases/output/output-library-single/test.opts b/test/binCases/output/output-library-single/test.opts deleted file mode 100644 index df1f1af62a7..00000000000 --- a/test/binCases/output/output-library-single/test.opts +++ /dev/null @@ -1,5 +0,0 @@ -./index.js --o ../../../js/bin/output/output-library-single/bundle.js ---target async-node ---output-library-target window ---output-library key1