]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test: fix tsconfig for mocha tests
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 28 Jun 2019 15:54:07 +0000 (17:54 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 28 Jun 2019 15:54:07 +0000 (17:54 +0200)
rollup.config.js
tsconfig.json

index 1e89557b63889add787862f21b4e9dcb8640512d..39d331675ad817453e7d006763c59d38a8625bab 100644 (file)
@@ -76,6 +76,7 @@ function createEntry(
         compilerOptions: {
           // same for d.ts files
           declaration: format === 'es' && isBrowser && !minify,
+          module: 'esnext', // we need to override it because mocha requires this value to be commonjs
           target: format === 'iife' || format === 'cjs' ? 'es3' : 'esnext',
         },
       },
index b78a6bdfef794a5613c7a8a9735cd20795bad365..927a40dc6a7aa98bccff7ca04613a52af20fabd1 100644 (file)
@@ -3,7 +3,8 @@
   "compilerOptions": {
     /* Basic Options */
     "target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
-    "module": "esnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
+    // Necessary for tests with mocha
+    "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
     // "lib": ["es2017.object"] /* Specify library files to be included in the compilation. */,
     // "allowJs": true,                       /* Allow javascript files to be compiled. */
     // "checkJs": true,                       /* Report errors in .js files. */