-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a single index.ts file to fix web imports
When package.json main points to index.js it is always used regardless of whether there is an index.web.js and config.resolve.extensions prefers '.web.js' extensions because the extionsion is already specified in the main field. A single index.js file re-exporting from either RNSVG.js or RNSVG.web.js allows Webpack to intercept the extension resolution correctly.
- Loading branch information
Showing
3 changed files
with
79 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import Shape from './elements/Shape'; | ||
import Rect, { RNSVGRect } from './elements/Rect'; | ||
import Circle, { RNSVGCircle } from './elements/Circle'; | ||
import Ellipse, { RNSVGEllipse } from './elements/Ellipse'; | ||
import Polygon from './elements/Polygon'; | ||
import Polyline from './elements/Polyline'; | ||
import Line, { RNSVGLine } from './elements/Line'; | ||
import Svg, { RNSVGSvg } from './elements/Svg'; | ||
import Path, { RNSVGPath } from './elements/Path'; | ||
import G, { RNSVGGroup } from './elements/G'; | ||
import Text, { RNSVGText } from './elements/Text'; | ||
import TSpan, { RNSVGTSpan } from './elements/TSpan'; | ||
import TextPath, { RNSVGTextPath } from './elements/TextPath'; | ||
import Use, { RNSVGUse } from './elements/Use'; | ||
import Image, { RNSVGImage } from './elements/Image'; | ||
import Symbol, { RNSVGSymbol } from './elements/Symbol'; | ||
import Defs, { RNSVGDefs } from './elements/Defs'; | ||
import LinearGradient, { RNSVGLinearGradient } from './elements/LinearGradient'; | ||
import RadialGradient, { RNSVGRadialGradient } from './elements/RadialGradient'; | ||
import Stop from './elements/Stop'; | ||
import ClipPath, { RNSVGClipPath } from './elements/ClipPath'; | ||
import Pattern, { RNSVGPattern } from './elements/Pattern'; | ||
import Mask, { RNSVGMask } from './elements/Mask'; | ||
import { parse, SvgAst, SvgFromUri, SvgFromXml, SvgUri, SvgXml } from './xml'; | ||
|
||
export { | ||
Svg, | ||
Circle, | ||
Ellipse, | ||
G, | ||
Text, | ||
TSpan, | ||
TextPath, | ||
Path, | ||
Polygon, | ||
Polyline, | ||
Line, | ||
Rect, | ||
Use, | ||
Image, | ||
Symbol, | ||
Defs, | ||
LinearGradient, | ||
RadialGradient, | ||
Stop, | ||
ClipPath, | ||
Pattern, | ||
Mask, | ||
parse, | ||
SvgAst, | ||
SvgFromUri, | ||
SvgFromXml, | ||
SvgUri, | ||
SvgXml, | ||
Shape, | ||
RNSVGMask, | ||
RNSVGPattern, | ||
RNSVGClipPath, | ||
RNSVGRadialGradient, | ||
RNSVGLinearGradient, | ||
RNSVGDefs, | ||
RNSVGSymbol, | ||
RNSVGImage, | ||
RNSVGUse, | ||
RNSVGTextPath, | ||
RNSVGTSpan, | ||
RNSVGText, | ||
RNSVGGroup, | ||
RNSVGPath, | ||
RNSVGLine, | ||
RNSVGEllipse, | ||
RNSVGCircle, | ||
RNSVGRect, | ||
RNSVGSvg, | ||
}; | ||
|
||
export default Svg; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,3 @@ | ||
import Shape from './elements/Shape'; | ||
import Rect, { RNSVGRect } from './elements/Rect'; | ||
import Circle, { RNSVGCircle } from './elements/Circle'; | ||
import Ellipse, { RNSVGEllipse } from './elements/Ellipse'; | ||
import Polygon from './elements/Polygon'; | ||
import Polyline from './elements/Polyline'; | ||
import Line, { RNSVGLine } from './elements/Line'; | ||
import Svg, { RNSVGSvg } from './elements/Svg'; | ||
import Path, { RNSVGPath } from './elements/Path'; | ||
import G, { RNSVGGroup } from './elements/G'; | ||
import Text, { RNSVGText } from './elements/Text'; | ||
import TSpan, { RNSVGTSpan } from './elements/TSpan'; | ||
import TextPath, { RNSVGTextPath } from './elements/TextPath'; | ||
import Use, { RNSVGUse } from './elements/Use'; | ||
import Image, { RNSVGImage } from './elements/Image'; | ||
import Symbol, { RNSVGSymbol } from './elements/Symbol'; | ||
import Defs, { RNSVGDefs } from './elements/Defs'; | ||
import LinearGradient, { RNSVGLinearGradient } from './elements/LinearGradient'; | ||
import RadialGradient, { RNSVGRadialGradient } from './elements/RadialGradient'; | ||
import Stop from './elements/Stop'; | ||
import ClipPath, { RNSVGClipPath } from './elements/ClipPath'; | ||
import Pattern, { RNSVGPattern } from './elements/Pattern'; | ||
import Mask, { RNSVGMask } from './elements/Mask'; | ||
import { parse, SvgAst, SvgFromUri, SvgFromXml, SvgUri, SvgXml } from './xml'; | ||
export * from './ReactNativeSVG'; | ||
|
||
export { | ||
Svg, | ||
Circle, | ||
Ellipse, | ||
G, | ||
Text, | ||
TSpan, | ||
TextPath, | ||
Path, | ||
Polygon, | ||
Polyline, | ||
Line, | ||
Rect, | ||
Use, | ||
Image, | ||
Symbol, | ||
Defs, | ||
LinearGradient, | ||
RadialGradient, | ||
Stop, | ||
ClipPath, | ||
Pattern, | ||
Mask, | ||
parse, | ||
SvgAst, | ||
SvgFromUri, | ||
SvgFromXml, | ||
SvgUri, | ||
SvgXml, | ||
Shape, | ||
RNSVGMask, | ||
RNSVGPattern, | ||
RNSVGClipPath, | ||
RNSVGRadialGradient, | ||
RNSVGLinearGradient, | ||
RNSVGDefs, | ||
RNSVGSymbol, | ||
RNSVGImage, | ||
RNSVGUse, | ||
RNSVGTextPath, | ||
RNSVGTSpan, | ||
RNSVGText, | ||
RNSVGGroup, | ||
RNSVGPath, | ||
RNSVGLine, | ||
RNSVGEllipse, | ||
RNSVGCircle, | ||
RNSVGRect, | ||
RNSVGSvg, | ||
}; | ||
|
||
export default Svg; | ||
export { default } from './ReactNativeSVG'; |