Moved to ESBuild

Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2021-07-19 14:44:42 +02:00
parent e172465258
commit 7c253c98d7
4 changed files with 74 additions and 1353 deletions

1273
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,60 +1,58 @@
{ {
"name": "@tcgdex/sdk", "name": "@tcgdex/sdk",
"version": "2.4.2", "version": "2.4.2",
"main": "./dist/cjs/tcgdex.node.js", "main": "./dist/cjs/tcgdex.node.js",
"types": "./dist/types/tcgdex.d.ts", "types": "./dist/types/tcgdex.d.ts",
"description": "Communicate with the Open Source TCGdex API in Javascript/Typescript using the SDK", "description": "Communicate with the Open Source TCGdex API in Javascript/Typescript using the SDK",
"repository": "https://github.com/tcgdex/javascript-sdk.git", "repository": "https://github.com/tcgdex/javascript-sdk.git",
"homepage": "https://github.com/tcgdex/javascript-sdk", "homepage": "https://github.com/tcgdex/javascript-sdk",
"author": "Aviortheking", "author": "Aviortheking",
"keywords": [ "keywords": [
"tcgdex", "tcgdex",
"pokemon", "pokemon",
"trading", "trading",
"card", "card",
"tcg", "tcg",
"sdk", "sdk",
"api", "api",
"typescript", "typescript",
"javascript", "javascript",
"typing" "typing"
], ],
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.14.6", "@babel/core": "^7.14.6",
"@babel/preset-env": "^7.14.7", "@babel/preset-env": "^7.14.7",
"@babel/preset-typescript": "^7.14.5", "@babel/preset-typescript": "^7.14.5",
"@dzeio/config": "^1.0.0", "@dzeio/config": "^1.0.0",
"@types/node-fetch": "^2.5.10", "@types/node-fetch": "^2.5.10",
"@typescript-eslint/eslint-plugin": "^4.28.0", "@typescript-eslint/eslint-plugin": "^4.28.0",
"@typescript-eslint/parser": "^4.28.0", "@typescript-eslint/parser": "^4.28.0",
"eslint": "^7.29.0", "esbuild": "^0.12.15",
"jest": "^27.0.5", "eslint": "^7.29.0",
"ts-loader": "^9.2.3", "jest": "^27.0.5",
"ts-node": "^10.0.0", "ts-node": "^10.0.0",
"typescript": "^4.1.3", "typescript": "^4.1.3"
"webpack": "^5.40.0", },
"webpack-nano": "^1.1.1" "engines": {
}, "node": ">=12"
"engines": { },
"node": ">=12" "dependencies": {
}, "isomorphic-unfetch": "^3.1.0",
"dependencies": { "unfetch": "^4.2.0"
"isomorphic-unfetch": "^3.1.0", },
"unfetch": "^4.2.0" "scripts": {
}, "prebuild": "node scripts/export-version-number.js",
"scripts": { "build": "npm run prebuild && npm run build:cjs && npm run build:browser && npm run build:es2015",
"prebuild": "node scripts/export-version-number.js", "build:cjs": "tsc --project tsconfig.json",
"build": "npm run prebuild && npm run build:cjs && npm run build:browser && npm run build:es2015", "build:es2015": "tsc --project tsconfig.es2015.json",
"build:cjs": "tsc --project tsconfig.json", "build:browser": "esbuild ./src/tcgdex.browser.ts --bundle --minify --sourcemap --target=es2016,chrome90,firefox78,safari14,ios13,edge90 --outfile=dist/tcgdex.browser.js",
"build:es2015": "tsc --project tsconfig.es2015.json", "prepublishOnly": "npm run build",
"build:browser": "wp --config webpack.config.js", "lint": "eslint",
"prepublishOnly": "npm run build", "test": "jest --coverage"
"lint": "eslint", },
"test": "jest --coverage" "files": [
}, "dist"
"files": [ ],
"dist" "sideEffects": false
], }
"sideEffects": false
}

View File

@ -3,4 +3,4 @@ import unfetch from 'unfetch'
TCGdex.fetch = window.fetch ?? unfetch as any TCGdex.fetch = window.fetch ?? unfetch as any
module.exports = TCGdex (global ?? window).TCGdex = TCGdex

View File

@ -1,34 +0,0 @@
const path = require('path')
module.exports = {
mode: 'production',
entry: './src/tcgdex.browser.ts',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'tcgdex.browser.js',
libraryTarget: 'umd',
library: 'TCGdex',
umdNamedDefine: true
},
resolve: {
extensions: ['.ts']
},
optimization: {
minimize: true
},
module: {
rules: [{
test: /\.ts$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
compilerOptions: {
sourceMap: false,
declaration: false,
declarationDir: null,
target: 'ES2016'
}
}
}]
}
}