mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-28 13:03:12 +00:00
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.
This commit is contained in:
committed by
Mikael Sand
parent
467dd22d3e
commit
2a26a1b3cf
@@ -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;
|
||||
+2
-76
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user