]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
build: refactor to build esm version
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 6 May 2019 13:57:48 +0000 (15:57 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 6 May 2019 13:57:48 +0000 (15:57 +0200)
__tests__/tsconfig.json [new file with mode: 0644]
explorations/tsconfig.json [new file with mode: 0644]
package.json
tsconfig.json
yarn.lock

diff --git a/__tests__/tsconfig.json b/__tests__/tsconfig.json
new file mode 100644 (file)
index 0000000..59ce020
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "include": ["./**/*.ts"],
+  "compilerOptions": {
+    "target": "esnext",
+    "module": "commonjs",
+    "allowJs": true
+  }
+}
diff --git a/explorations/tsconfig.json b/explorations/tsconfig.json
new file mode 100644 (file)
index 0000000..fa8b346
--- /dev/null
@@ -0,0 +1,20 @@
+{
+  "include": ["./**/*.ts"],
+  "compilerOptions": {
+    "target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
+    "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. */,
+    // "declaration": true /* Generates corresponding '.d.ts' file. */,
+    // "declarationMap": true,                /* Generates a sourcemap for each corresponding '.d.ts' file. */
+    "sourceMap": true /* Generates corresponding '.map' file. */,
+    // "outFile": "./",                       /* Concatenate and emit output to single file. */
+    "outDir": "./dist" /* Redirect output structure to the directory. */,
+
+    "strict": true /* Enable all strict type-checking options. */,
+    "noUnusedLocals": true /* Report errors on unused locals. */,
+    "noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
+
+    "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
+    "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
+  }
+}
index 7d7abb8eca2348b770e9801acaac016d469bdeba..9b5015e7ca05c418c62296a66a7f1d98386cf01a 100644 (file)
@@ -9,12 +9,12 @@
     "test:mocha": "NODE_ENV=test mocha -r ts-node/register __tests__/**/*.spec.js __tests__/*.spec.js",
     "test:mocha:dev": "yarn run test:mocha -w --extension ts --reporter min",
     "test": "yarn run test:unit",
+    "build:esm": "yarn tsc -d -t ESNEXT -m ESNext",
     "dev": "webpack-dev-server --mode=development"
   },
   "devDependencies": {
     "@types/jest": "^24.0.11",
     "@types/jsdom": "^12.2.3",
-    "@types/mocha": "^5.2.6",
     "consola": "^2.5.8",
     "expect": "^24.7.1",
     "faked-promise": "^2.1.0",
index 6331e3a745d07e035c73ab8094c775ac9b2a2110..1f7761affa92bfdbac37443dd78e26e282d0f2f4 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "include": ["src/**/*.ts", "explorations/**/*.ts"],
+  "include": ["src/**/*.ts"],
   "compilerOptions": {
     /* Basic Options */
     "target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
@@ -8,7 +8,7 @@
     // "allowJs": true,                       /* Allow javascript files to be compiled. */
     // "checkJs": true,                       /* Report errors in .js files. */
     // "jsx": "preserve",                     /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
-    // "declaration": true,                   /* Generates corresponding '.d.ts' file. */
+    "declaration": true /* Generates corresponding '.d.ts' file. */,
     // "declarationMap": true,                /* Generates a sourcemap for each corresponding '.d.ts' file. */
     "sourceMap": true /* Generates corresponding '.map' file. */,
     // "outFile": "./",                       /* Concatenate and emit output to single file. */
index 6a673eb400e096f654c4e55c1384b3f8477cb8cb..1698ab1aeb65d74e6b3daab2f95e309ee5f6e28a 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
     "@types/tough-cookie" "*"
     parse5 "^4.0.0"
 
-"@types/mocha@^5.2.6":
-  version "5.2.6"
-  resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.6.tgz#b8622d50557dd155e9f2f634b7d68fd38de5e94b"
-  integrity sha512-1axi39YdtBI7z957vdqXI4Ac25e7YihYQtJa+Clnxg1zTJEaIRbndt71O3sP4GAMgiAm0pY26/b9BrY4MR/PMw==
-
 "@types/node@*":
   version "11.13.0"
   resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.0.tgz#b0df8d6ef9b5001b2be3a94d909ce3c29a80f9e1"