From 8f53a3c23a1e0c3d57271c631cc6ea87e37d733f Mon Sep 17 00:00:00 2001 From: rozetko Date: Tue, 17 May 2022 17:52:42 +0400 Subject: [PATCH] do not bundle core, d3 and lodash && dev bundle --- build/dev.webpack.conf.js | 2 +- build/prod.webpack.conf.js | 3 +++ examples/01-basic.html | 2 +- examples/02-reversed.html | 2 +- package.json | 10 +++------- src/index.ts | 3 +-- yarn.lock | 21 ++++++++++++--------- 7 files changed, 22 insertions(+), 21 deletions(-) diff --git a/build/dev.webpack.conf.js b/build/dev.webpack.conf.js index d8afe83..31274e1 100644 --- a/build/dev.webpack.conf.js +++ b/build/dev.webpack.conf.js @@ -2,7 +2,7 @@ const baseWebpackConfig = require('./base.webpack.conf'); var conf = baseWebpackConfig; conf.devtool = 'inline-source-map'; -conf.watch = true; conf.mode = 'development'; +conf.output.filename = 'index.dev.js' module.exports = conf; diff --git a/build/prod.webpack.conf.js b/build/prod.webpack.conf.js index c079cff..e30710d 100644 --- a/build/prod.webpack.conf.js +++ b/build/prod.webpack.conf.js @@ -2,5 +2,8 @@ const baseWebpackConfig = require('./base.webpack.conf'); var conf = baseWebpackConfig; conf.mode = 'production'; +conf.externals = [ + '@chartwerk/core' +]; module.exports = baseWebpackConfig; diff --git a/examples/01-basic.html b/examples/01-basic.html index 9b0e831..f9ff367 100644 --- a/examples/01-basic.html +++ b/examples/01-basic.html @@ -4,7 +4,7 @@ - +
diff --git a/examples/02-reversed.html b/examples/02-reversed.html index d45c114..8707a45 100644 --- a/examples/02-reversed.html +++ b/examples/02-reversed.html @@ -4,7 +4,7 @@ - +
diff --git a/package.json b/package.json index 5533825..7275a33 100644 --- a/package.json +++ b/package.json @@ -4,21 +4,17 @@ "description": "Chartwerk gauge pod", "main": "dist/index.js", "scripts": { - "build": "webpack --config build/prod.webpack.conf.js", - "dev": "webpack --config build/dev.webpack.conf.js", + "build": "webpack --config build/prod.webpack.conf.js && webpack --config build/dev.webpack.conf.js", + "dev": "webpack --watch --config build/dev.webpack.conf.js", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "CorpGlory", "license": "Apache-2.0", "dependencies": { - "@chartwerk/core": "^0.4.1" + "@chartwerk/core": "^0.5.0-beta" }, "devDependencies": { - "@types/d3": "^5.7.2", - "@types/lodash": "^4.14.149", "css-loader": "^3.4.2", - "d3": "^5.15.0", - "lodash": "^4.17.15", "style-loader": "^1.1.3", "ts-loader": "^6.2.1", "typescript": "^3.8.3", diff --git a/src/index.ts b/src/index.ts index 07d6fc4..b38ab10 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,7 +15,6 @@ const DEFAULT_INNER_RADIUS = 52; const DEFAULT_OUTER_RADIUS = 72; const STOPS_CIRCLE_WIDTH = 8; const DEFAULT_VALUE_TEXT_FONT_SIZE = 16; -const DEFAULT_VALUE_TEXT_Decimals = 2; const VALUE_TEXT_MARGIN = 10; const DEFAULT_ICON_SIZE = 20; //px @@ -91,7 +90,7 @@ export class ChartwerkGaugePod extends ChartwerkPod