Repository: webpack-contrib/uglifyjs-webpack-plugin (js)

Issue:
uglifyjs-webpack-plugin cannot uglify any file
this is my code:
```
new UglifyJsPlugin({
    uglifyOptions: {
         ie8: false,
	 ecma: 8,
	 //parse: {...options},
	 mangle: {
		 properties: {
		          // mangle property options
		  }
	  },
	 output: {
		   comments: false,
		   beautify: false
	  },
	 compress: {
	  },
	 warnings: false
    }
 })
```
 I used es7, es6, if i use webpack.optimize.UglifyJsPlugin , it can work normally.

```
"uglifyjs-webpack-plugin": "^1.1.8",   
 "webpack": "^3.10.0"
```


Pull request description:
fix(index): relax default in asset names `{RegExp}` (`options.test`)
### `Issues`

- Fixes #220


Patch:
diff --git a/src/index.js b/src/index.js
index 9e0ea24..aa4b237 100644
--- a/src/index.js
+++ b/src/index.js
@@ -21,7 +21,7 @@ class UglifyJsPlugin {
 
     const {
       uglifyOptions = {},
-      test = /\.js$/i,
+      test = /\.(js?)(\?.+)?$/i,
       warningsFilter = () => true,
       extractComments = false,
       sourceMap = false,


Test patch:
diff --git a/test/__snapshots__/test.test.js.snap b/test/__snapshots__/test.test.js.snap
new file mode 100644
index 0000000..2131471
--- /dev/null
+++ b/test/__snapshots__/test.test.js.snap
@@ -0,0 +1,17 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`empty option: 0.0.js?ver=bd0395a3b5883cc6e11c 1`] = `"webpackJsonp([0],{5:function(e,t,c){\\"use strict\\";Object.defineProperty(t,\\"__esModule\\",{value:!0}),t.default=\\"async-dep\\"}});"`;
+
+exports[`empty option: AsyncImportExport.js?var=bd0395a3b5883cc6e11c 1`] = `"webpackJsonp([4],{4:function(e,o,n){\\"use strict\\";Object.defineProperty(o,\\"__esModule\\",{value:!0}),n.e(0).then(n.bind(null,5)).then(()=>{console.log(\\"Good\\")}),o.default=\\"Awesome\\"}},[4]);"`;
+
+exports[`empty option: errors 1`] = `Array []`;
+
+exports[`empty option: importExport.js?var=bd0395a3b5883cc6e11c 1`] = `"webpackJsonp([1],[,,function(t,a,e){\\"use strict\\";Object.defineProperty(a,\\"__esModule\\",{value:!0});var n=e(3);a.default=function(){const t=n.b,a=\`baz\${Math.random()}\`;return()=>({a:t+n.a+a,b:t,baz:a})}},function(t,a,e){\\"use strict\\";a.a=\\"bar\\",a.b=\\"foo\\"}],[2]);"`;
+
+exports[`empty option: js.js?var=bd0395a3b5883cc6e11c 1`] = `"webpackJsonp([3],[function(o,n){o.exports=function(){console.log(7)}}],[0]);"`;
+
+exports[`empty option: manifest.js?var=bd0395a3b5883cc6e11c 1`] = `"!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(n,c,i){for(var u,a,p,s=0,f=[];s<n.length;s++)a=n[s],t[a]&&f.push(t[a][0]),t[a]=0;for(u in c)Object.prototype.hasOwnProperty.call(c,u)&&(e[u]=c[u]);for(r&&r(n,c,i);f.length;)f.shift()();if(i)for(s=0;s<i.length;s++)p=o(o.s=i[s]);return p};var n={},t={5:0};function o(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var r=t[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var n=new Promise(function(n,o){r=t[e]=[n,o]});r[2]=n;var c=document.getElementsByTagName(\\"head\\")[0],i=document.createElement(\\"script\\");i.type=\\"text/javascript\\",i.charset=\\"utf-8\\",i.async=!0,i.timeout=12e4,o.nc&&i.setAttribute(\\"nonce\\",o.nc),i.src=o.p+\\"\\"+e+\\".\\"+({1:\\"importExport\\",2:\\"mjs\\",3:\\"js\\",4:\\"AsyncImportExport\\"}[e]||e)+\\".js?ver=bd0395a3b5883cc6e11c\\";var u=setTimeout(a,12e4);function a(){i.onerror=i.onload=null,clearTimeout(u);var r=t[e];0!==r&&(r&&r[1](new Error(\\"Loading chunk \\"+e+\\" failed.\\")),t[e]=void 0)}return i.onerror=i.onload=a,c.appendChild(i),n},o.m=e,o.c=n,o.d=function(e,r,n){o.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,\\"a\\",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p=\\"\\",o.oe=function(e){throw console.error(e),e}}([]);"`;
+
+exports[`empty option: mjs.js?var=bd0395a3b5883cc6e11c 1`] = `"webpackJsonp([2],[,function(o,n){o.exports=function(){console.log(7)}}],[1]);"`;
+
+exports[`empty option: warnings 1`] = `Array []`;
diff --git a/test/fixtures/async-import-export/async-dep.js b/test/fixtures/async-import-export/async-dep.js
new file mode 100644
index 0000000..d339c33
--- /dev/null
+++ b/test/fixtures/async-import-export/async-dep.js
@@ -0,0 +1,1 @@
+export default "async-dep";
diff --git a/test/fixtures/async-import-export/entry.js b/test/fixtures/async-import-export/entry.js
new file mode 100644
index 0000000..2368145
--- /dev/null
+++ b/test/fixtures/async-import-export/entry.js
@@ -0,0 +1,5 @@
+import("./async-dep").then(() => {
+  console.log('Good')
+});
+
+export default "Awesome";
diff --git a/test/fixtures/entry.mjs b/test/fixtures/entry.mjs
new file mode 100644
index 0000000..575daaf
--- /dev/null
+++ b/test/fixtures/entry.mjs
@@ -0,0 +1,9 @@
+// foo
+/* @preserve*/
+// bar
+const a = 2 + 2;
+
+module.exports = function Foo() {
+  const b = 2 + 2;
+  console.log(b + 1 + 2);
+};
diff --git a/test/fixtures/import-export/async-dep.js b/test/fixtures/import-export/async-dep.js
new file mode 100644
index 0000000..d339c33
--- /dev/null
+++ b/test/fixtures/import-export/async-dep.js
@@ -0,0 +1,1 @@
+export default "async-dep";
diff --git a/test/test.test.js b/test/test.test.js
new file mode 100644
index 0000000..1ec8374
--- /dev/null
+++ b/test/test.test.js
@@ -0,0 +1,40 @@
+import UglifyJsPlugin from '../src/index';
+import {
+  cleanErrorStack,
+  createCompiler,
+  compile,
+} from './helpers';
+
+describe('when applied with test option', () => {
+  it('with empty value', () => {
+    const compiler = createCompiler({
+      entry: {
+        js: `${__dirname}/fixtures/entry.js`,
+        mjs: `${__dirname}/fixtures/entry.mjs`,
+        importExport: `${__dirname}/fixtures/import-export/entry.js`,
+        AsyncImportExport: `${__dirname}/fixtures/async-import-export/entry.js`,
+      },
+      output: {
+        path: `${__dirname}/dist`,
+        filename: '[name].js?var=[hash]',
+        chunkFilename: '[id].[name].js?ver=[hash]',
+      },
+    });
+
+    new UglifyJsPlugin().apply(compiler);
+
+    return compile(compiler).then((stats) => {
+      const errors = stats.compilation.errors.map(cleanErrorStack);
+      const warnings = stats.compilation.warnings.map(cleanErrorStack);
+
+      expect(errors).toMatchSnapshot('empty option: errors');
+      expect(warnings).toMatchSnapshot('empty option: warnings');
+
+      for (const file in stats.compilation.assets) {
+        if (Object.prototype.hasOwnProperty.call(stats.compilation.assets, file)) {
+          expect(stats.compilation.assets[file].source()).toMatchSnapshot(`empty option: ${file}`);
+        }
+      }
+    });
+  });
+});