mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
fix watch mode
This commit is contained in:
parent
76299cd07a
commit
521070cb05
@ -142,9 +142,8 @@ To make a full build run `npm run build`. The command will compile all typescrip
|
|||||||
Konva uses Mocha for testing.
|
Konva uses Mocha for testing.
|
||||||
|
|
||||||
* If you need run test only one time run `npm run test`.
|
* If you need run test only one time run `npm run test`.
|
||||||
* While developing it is easy to use `npm start`. Just run it and go to [http://localhost:8080/test/runner.html](http://localhost:8080/test/runner.html). If you need changed typescript sources you have to run `npm run build`.
|
* While developing it is easy to use `npm start`. Just run it and go to [http://localhost:8080/test/runner.html](http://localhost:8080/test/runner.html). The watcher will rebuild the bundle on any change.
|
||||||
|
|
||||||
TODO: add watcher for typescript changes.
|
|
||||||
|
|
||||||
Konva is covered with hundreds of tests and well over a thousand assertions.
|
Konva is covered with hundreds of tests and well over a thousand assertions.
|
||||||
Konva uses TDD (test driven development) which means that every new feature or bug fix is accompanied with at least one new test.
|
Konva uses TDD (test driven development) which means that every new feature or bug fix is accompanied with at least one new test.
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
"module": "konva.esm.js",
|
"module": "konva.esm.js",
|
||||||
"typings": "./konva.d.ts",
|
"typings": "./konva.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "gulp",
|
"start": "npm run watch & gulp",
|
||||||
"lint": "gulp lint",
|
"lint": "gulp lint",
|
||||||
"build": "npm run compile && gulp build",
|
"build": "npm run compile && gulp build",
|
||||||
"full-build": "npm run build && npm t",
|
"full-build": "npm run build && npm t",
|
||||||
@ -21,7 +21,8 @@
|
|||||||
"prettier": "prettier --write \"src/**/*.js\" \"test/**/*.js\" --single-quote",
|
"prettier": "prettier --write \"src/**/*.js\" \"test/**/*.js\" --single-quote",
|
||||||
"tsc": "tsc || echo \"tsc faild for some file(s).\"",
|
"tsc": "tsc || echo \"tsc faild for some file(s).\"",
|
||||||
"rollup": "rollup -c",
|
"rollup": "rollup -c",
|
||||||
"compile": "npm run tsc && npm run rollup"
|
"compile": "npm run tsc && npm run rollup",
|
||||||
|
"watch": "rollup -c -w"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "4.1.2",
|
"chai": "4.1.2",
|
||||||
|
@ -41,7 +41,7 @@ export default {
|
|||||||
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
|
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
|
||||||
external: [],
|
external: [],
|
||||||
watch: {
|
watch: {
|
||||||
include: 'ts/**'
|
include: 'src/**'
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
// Allow json resolution
|
// Allow json resolution
|
||||||
|
@ -365,9 +365,7 @@ export class Text extends Shape {
|
|||||||
|
|
||||||
this.textArr = [];
|
this.textArr = [];
|
||||||
getDummyContext().font = this._getContextFont();
|
getDummyContext().font = this._getContextFont();
|
||||||
var additionalWidth = shouldAddEllipsis
|
var additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0;
|
||||||
? this._getTextWidth(ELLIPSIS)
|
|
||||||
: 0;
|
|
||||||
for (var i = 0, max = lines.length; i < max; ++i) {
|
for (var i = 0, max = lines.length; i < max; ++i) {
|
||||||
var line = lines[i];
|
var line = lines[i];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user