Skip to content

Commit

Permalink
fix: 🐛 transpile to ES5
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 10, 2020
1 parent 50bf1ba commit 1c9ebbd
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 11 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"@rollup/plugin-node-resolve": "^8.0.0",
"@rollup/plugin-replace": "^2.3.2",
"@rollup/plugin-sucrase": "^3.0.2",
"@rollup/plugin-typescript": "^4.1.2",
"@types/eslint": "^6.8.1",
"@types/eslint-plugin-prettier": "3.1.0",
"@types/prettier": "^2.0.1",
Expand All @@ -97,6 +98,7 @@
"rollup": "^2.12.1",
"rollup-plugin-copy": "^3.3.0",
"rollup-plugin-terser": "^6.1.0",
"tslib": "^2.0.0",
"typescript": "^3.9.3",
"typesync": "^0.7.0"
}
Expand Down
37 changes: 37 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import sucrase from "@rollup/plugin-sucrase"
// import sucrase from "@rollup/plugin-sucrase"
import resolve from "@rollup/plugin-node-resolve"
import replace from "@rollup/plugin-replace"
import { terser } from "rollup-plugin-terser"
// import { terser } from "rollup-plugin-terser"
import typescript from "@rollup/plugin-typescript"
import path from "path"
import { chmodSync } from "fs"
import copy from "rollup-plugin-copy"
Expand Down Expand Up @@ -58,11 +59,15 @@ export default {
resolve({
extensions: [".js", ".ts"],
}),
sucrase({
production: false,
exclude: ["node_modules/**"],
transforms: ["typescript"],
}),
typescript(),
// sucrase({
// production: false,
// exclude: ["node_modules/**"],
// transforms: ["typescript"],
// }),
// getBabelOutputPlugin({
// presets: [["@babel/preset-env", { modules: "umd" }]],
// }),
// terser(),
executable(),
copy({
Expand Down
8 changes: 4 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es2015" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"module": "es2015" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
"lib": [] /* Specify library files to be included in the compilation. */,
// "allowJs": true, /* Allow javascript files to be compiled. */
Expand All @@ -14,14 +14,14 @@
// "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": "./lib" /* Redirect output structure to the directory. */,
// "outDir": "./lib" /* Redirect output structure to the directory. */,
"rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
"noEmit": true /* Do not emit outputs. */,
"importHelpers": true /* Import emit helpers from 'tslib'. */,
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
"importHelpers": false /* Import emit helpers from 'tslib'. */,
"downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */,
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */

/* Strict Type-Checking Options */
Expand Down

0 comments on commit 1c9ebbd

Please sign in to comment.