Skip to content

Commit

Permalink
chore: removed babel for node usage
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Dec 13, 2021
1 parent 47beacc commit 6ad7cfe
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 19 deletions.
9 changes: 0 additions & 9 deletions .babelrc

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
"unpkg": "./dist/index.bundle.js",
"scripts": {
"build": "concurrently 'npm:build:*'",
"build:node": "babel src --out-dir dist --extensions '.ts' --ignore src/index.bundle.ts",
"build:browser": "webpack",
"build:types": "tsc -p tsconfig.types.json",
"build:node": "tsc -p tsconfig.build.json",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
Expand Down Expand Up @@ -51,8 +50,10 @@
"@babel/cli": "^7.16.0",
"@babel/core": "^7.16.0",
"@babel/plugin-transform-modules-commonjs": "^7.16.0",
"@babel/plugin-transform-runtime": "^7.16.4",
"@babel/preset-env": "^7.16.4",
"@babel/preset-typescript": "^7.16.0",
"@babel/runtime": "^7.16.3",
"@types/jest": "^27.0.2",
"@types/node": "^16.7.10",
"@types/webpack": "^5.28.0",
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.types.json → tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"emitDeclarationOnly": true
"noEmit": false
},
"include": ["src"],
"exclude": ["src/index.bundle.ts"]
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */

/* Language and Environment */
"target": "ES2020" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"target": "ES6" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
Expand Down Expand Up @@ -45,10 +45,10 @@
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
"declarationMap": true /* Create sourcemaps for d.ts files. */,
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
"sourceMap": true /* Create source map files for emitted JavaScript files. */,
// "sourceMap": true /* Create source map files for emitted JavaScript files. */,
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
// "removeComments": true, /* Disable emitting comments. */
"removeComments": true, /* Disable emitting comments. */
"noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
"importsNotUsedAsValues": "error" /* Specify emit/checking behavior for imports that are only used for types */,
Expand Down
6 changes: 4 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const config = {
rules: [
{
test: /\.(ts|js)$/,
exclude: { and: [/node_modules/] },
use: {
loader: 'babel-loader',
options: {
Expand All @@ -36,7 +35,10 @@ const config = {
['@babel/preset-env', { targets: 'defaults' }],
'@babel/preset-typescript'
],
plugins: ['@babel/plugin-transform-modules-commonjs']
plugins: [
'@babel/plugin-transform-modules-commonjs',
'@babel/plugin-transform-runtime'
]
}
}
}
Expand Down
14 changes: 13 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,18 @@
dependencies:
"@babel/helper-plugin-utils" "^7.14.5"

"@babel/plugin-transform-runtime@^7.16.4":
version "7.16.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.16.4.tgz#f9ba3c7034d429c581e1bd41b4952f3db3c2c7e8"
integrity sha512-pru6+yHANMTukMtEZGC4fs7XPwg35v8sj5CIEmE+gEkFljFiVJxEWxx/7ZDkTK+iZRYo1bFXBtfIN95+K3cJ5A==
dependencies:
"@babel/helper-module-imports" "^7.16.0"
"@babel/helper-plugin-utils" "^7.14.5"
babel-plugin-polyfill-corejs2 "^0.3.0"
babel-plugin-polyfill-corejs3 "^0.4.0"
babel-plugin-polyfill-regenerator "^0.3.0"
semver "^6.3.0"

"@babel/plugin-transform-shorthand-properties@^7.16.0":
version "7.16.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.0.tgz#090372e3141f7cc324ed70b3daf5379df2fa384d"
Expand Down Expand Up @@ -899,7 +911,7 @@
"@babel/helper-validator-option" "^7.14.5"
"@babel/plugin-transform-typescript" "^7.16.0"

"@babel/runtime@^7.8.4":
"@babel/runtime@^7.16.3", "@babel/runtime@^7.8.4":
version "7.16.3"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5"
integrity sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ==
Expand Down

0 comments on commit 6ad7cfe

Please sign in to comment.