Skip to content

Commit 01adb33

Browse files
committed
imports: Use relative imports consistently
There is a mix of relative and non-relative imports. Webpack has an issue with non-relative imports unless the preferRelative resolve configuration is set true. This works for most of the non-relative imports except where ".." is used. Instead, a better solution is to use relative imports for all imports.
1 parent 53962b4 commit 01adb33

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Events } from './events.js';
2-
import { Constants } from 'constants.js';
2+
import { Constants } from './constants.js';
33

44
/**
55
* @name Two.Element

src/group.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import { Events } from './events.js';
22
import { _ } from './utils/underscore.js';
3-
import { getEffectFromObject } from 'utils/shape.js';
3+
import { getEffectFromObject } from './utils/shape.js';
44

55
import { Shape } from './shape.js';
66
import { Children } from './children.js';
7-
import { Path } from 'path.js';
8-
import { ArcSegment } from 'shapes/arc-segment.js';
9-
import { Circle } from 'shapes/circle.js';
10-
import { Ellipse } from 'shapes/ellipse.js';
11-
import { Points } from 'shapes/points.js';
12-
import { Polygon } from 'shapes/polygon.js';
13-
import { Rectangle } from 'shapes/rectangle.js';
14-
import { RoundedRectangle } from 'shapes/rounded-rectangle.js';
15-
import { Star } from 'shapes/star.js';
16-
import { Text } from 'text.js';
17-
import { Element } from 'element.js';
7+
import { Path } from './path.js';
8+
import { ArcSegment } from './shapes/arc-segment.js';
9+
import { Circle } from './shapes/circle.js';
10+
import { Ellipse } from './shapes/ellipse.js';
11+
import { Points } from './shapes/points.js';
12+
import { Polygon } from './shapes/polygon.js';
13+
import { Rectangle } from './shapes/rectangle.js';
14+
import { RoundedRectangle } from './shapes/rounded-rectangle.js';
15+
import { Star } from './shapes/star.js';
16+
import { Text } from './text.js';
17+
import { Element } from './element.js';
1818

1919
// Constants
2020

src/text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { LinearGradient } from './effects/linear-gradient.js';
88
import { RadialGradient } from './effects/radial-gradient.js';
99
import { Texture } from './effects/texture.js';
1010
import { root } from './utils/root.js';
11-
import { getEffectFromObject } from 'utils/shape.js';
11+
import { getEffectFromObject } from './utils/shape.js';
1212

1313
let canvas;
1414
const min = Math.min,

src/utils/shape.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Texture } from 'effects/texture.js';
1+
import { Texture } from '../effects/texture.js';
22
import { subdivide, getCurveLength as gcl } from './curves.js';
3-
import { Gradient } from 'effects/gradient.js';
4-
import { LinearGradient } from 'effects/linear-gradient.js';
5-
import { RadialGradient } from 'effects/radial-gradient.js';
3+
import { Gradient } from '../effects/gradient.js';
4+
import { LinearGradient } from '../effects/linear-gradient.js';
5+
import { RadialGradient } from '../effects/radial-gradient.js';
66

77
/**
88
* @private

0 commit comments

Comments
 (0)