mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 13:38:15 +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.
|
||||
|
||||
* 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 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",
|
||||
"typings": "./konva.d.ts",
|
||||
"scripts": {
|
||||
"start": "gulp",
|
||||
"start": "npm run watch & gulp",
|
||||
"lint": "gulp lint",
|
||||
"build": "npm run compile && gulp build",
|
||||
"full-build": "npm run build && npm t",
|
||||
@ -21,7 +21,8 @@
|
||||
"prettier": "prettier --write \"src/**/*.js\" \"test/**/*.js\" --single-quote",
|
||||
"tsc": "tsc || echo \"tsc faild for some file(s).\"",
|
||||
"rollup": "rollup -c",
|
||||
"compile": "npm run tsc && npm run rollup"
|
||||
"compile": "npm run tsc && npm run rollup",
|
||||
"watch": "rollup -c -w"
|
||||
},
|
||||
"devDependencies": {
|
||||
"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')
|
||||
external: [],
|
||||
watch: {
|
||||
include: 'ts/**'
|
||||
include: 'src/**'
|
||||
},
|
||||
plugins: [
|
||||
// Allow json resolution
|
||||
|
@ -365,9 +365,7 @@ export class Text extends Shape {
|
||||
|
||||
this.textArr = [];
|
||||
getDummyContext().font = this._getContextFont();
|
||||
var additionalWidth = shouldAddEllipsis
|
||||
? this._getTextWidth(ELLIPSIS)
|
||||
: 0;
|
||||
var additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0;
|
||||
for (var i = 0, max = lines.length; i < max; ++i) {
|
||||
var line = lines[i];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user