From 97afc5e716c8bcf5214ffb730a1ffee31fbc1978 Mon Sep 17 00:00:00 2001 From: hoonoh Date: Wed, 6 Nov 2019 14:41:25 +0900 Subject: [PATCH] build: update tsconfig & webpack (#31) fix for generate-ec2-types scheduler --- package.json | 1 - scripts/generate-ec2-types.ts | 2 +- tsconfig.json | 6 +++--- webpack.config.js | 10 +--------- yarn.lock | 8 -------- 5 files changed, 5 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index a0508443..36163ee9 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,6 @@ "prettier": "^1.18.2", "prompts": "^2.2.1", "semantic-release": "^15.13.27", - "string-replace-loader": "^2.2.0", "table": "^5.4.6", "ts-jest": "^24.1.0", "ts-loader": "^6.2.1", diff --git a/scripts/generate-ec2-types.ts b/scripts/generate-ec2-types.ts index ef560250..3509f9f6 100644 --- a/scripts/generate-ec2-types.ts +++ b/scripts/generate-ec2-types.ts @@ -92,7 +92,7 @@ const sortInstances = (i1: string, i2: string): number => { const getEc2Types = async (): Promise => { let prices; try { - prices = await getGlobalSpotPrices(); + prices = await getGlobalSpotPrices({}); } catch (error) { console.log(`getGlobalSpotPrices error: ${error}`); process.exit(1); diff --git a/tsconfig.json b/tsconfig.json index 88ae9eb0..e05835f4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "module": "esnext", - "target": "esnext", - "lib": ["esnext"], + "module": "commonjs", + "target": "es5", + "lib": ["es5"], "moduleResolution": "node", "strict": true, "strictPropertyInitialization": false, diff --git a/webpack.config.js b/webpack.config.js index b514a9f3..10374b4a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -19,14 +19,6 @@ module.exports = { target: 'node', module: { rules: [ - { - test: /cli\.ts$/, - loader: 'string-replace-loader', - options: { - search: "from './module'", - replace: "from '../dist/module'", - }, - }, { test: /\.tsx?$/, use: [ @@ -40,5 +32,5 @@ module.exports = { }, ], }, - externals: [/dist\/module$/], + externals: [/\.\/module$/], }; diff --git a/yarn.lock b/yarn.lock index 135c68c9..051dbc4c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8432,14 +8432,6 @@ string-length@^2.0.0: astral-regex "^1.0.0" strip-ansi "^4.0.0" -string-replace-loader@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/string-replace-loader/-/string-replace-loader-2.2.0.tgz#0a0e6543fcec783d85c353a3e96a23872d45a94f" - integrity sha512-Ukt4ZC8+xVWdBRut3/iwnPJCNL1yV8AbVKXn8UcWdYrHgtuW4UDDAbBSi/J/CQDEWQBt824AJvPYahF23eJLRg== - dependencies: - loader-utils "^1.2.3" - schema-utils "^1.0.0" - string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"