Browse Source

do not bundle core, d3 and lodash && dev bundle

merge-requests/1/head
rozetko 3 years ago
parent
commit
8f53a3c23a
  1. 2
      build/dev.webpack.conf.js
  2. 3
      build/prod.webpack.conf.js
  3. 2
      examples/01-basic.html
  4. 2
      examples/02-reversed.html
  5. 10
      package.json
  6. 3
      src/index.ts
  7. 21
      yarn.lock

2
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;

3
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;

2
examples/01-basic.html

@ -4,7 +4,7 @@
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<script src="../dist/index.js" type="text/javascript"></script>
<script src="../dist/index.dev.js" type="text/javascript"></script>
</head>
<body>
<div id="chart" style="width: 50%; height: 400px;"></div>

2
examples/02-reversed.html

@ -4,7 +4,7 @@
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<script src="../dist/index.js" type="text/javascript"></script>
<script src="../dist/index.dev.js" type="text/javascript"></script>
</head>
<body>
<div id="chart" style="width: 400px; height: 400px;"></div>

10
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",

3
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<GaugeTimeSerie, GaugeOptions
constructor(el: HTMLElement, _series: GaugeTimeSerie[] = [], _options: GaugeOptions = {}) {
super(
d3, el, _series,
el, _series,
_.defaults(_options, DEFAULT_GAUGE_OPTIONS)
);
}

21
yarn.lock

@ -2,10 +2,13 @@
# yarn lockfile v1
"@chartwerk/core@^0.4.1":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@chartwerk/core/-/core-0.4.1.tgz#c09f72a5c74911d3a760a814bdcec13d7b421fd6"
integrity sha512-t8axHIl5RnmEdQtOAWAQYfyVtc8+XOVz080ooIPbeLuAbC3n4647tgju4p0tOWnhqYNVP7vM1GIptqWYzLwx3w==
"@chartwerk/core@^0.5.0-beta":
version "0.5.0-beta"
resolved "https://registry.yarnpkg.com/@chartwerk/core/-/core-0.5.0-beta.tgz#b54ab3f6a3f47a140ba90b18d422f3dbf54d75f7"
integrity sha512-aXunseki0wAdJhA5rXC1tL0LbSyTGRUX91/3A1B0rEpE3XZBaLACcU/1lRWAAMgdBR85kZIiBRcw6HtdWUsWWQ==
dependencies:
d3 "^5.16.0"
lodash "^4.17.21"
"@types/d3-array@^1":
version "1.2.8"
@ -1189,7 +1192,7 @@ d3-zoom@1:
d3-selection "1"
d3-transition "1"
d3@^5.15.0:
d3@^5.16.0:
version "5.16.0"
resolved "https://registry.yarnpkg.com/d3/-/d3-5.16.0.tgz#9c5e8d3b56403c79d4ed42fbd62f6113f199c877"
integrity sha512-4PL5hHaHwX4m7Zr1UapXW23apo6pexCgdetdJ5kTmADpG/7T9Gkxw0M0tf/pjoB63ezCCm0u5UaFYy2aMt0Mcw==
@ -2022,10 +2025,10 @@ locate-path@^3.0.0:
p-locate "^3.0.0"
path-exists "^3.0.0"
lodash@^4.17.15:
version "4.17.20"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
lru-cache@^5.1.1:
version "5.1.1"

Loading…
Cancel
Save