Skip to content

Commit 76a507d

Browse files
committed
inline the svg in the js bundle
1 parent 3938f3a commit 76a507d

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

src/components/components/CommonComponents.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* global process */
21
import React from 'react';
32
import PropTypes from 'prop-types';
43
import { InputWidget } from '../widgets';
@@ -14,6 +13,7 @@ import {
1413
import Events from '../../lib/Events';
1514
import Clipboard from 'clipboard';
1615
import { saveBlob } from '../../lib/utils';
16+
import GLTFIcon from '../../../assets/gltf.svg';
1717

1818
// @todo Take this out and use updateEntity?
1919
function changeId(componentName, value) {
@@ -109,13 +109,7 @@ export default class CommonComponents extends React.Component {
109109
event.stopPropagation();
110110
}}
111111
>
112-
<img
113-
src={
114-
process.env.NODE_ENV === 'production'
115-
? 'https://aframe.io/aframe-inspector/assets/gltf.svg'
116-
: '../assets/gltf.svg'
117-
}
118-
/>
112+
<img src={GLTFIcon} />
119113
</a>
120114
<a
121115
href="#"

src/components/scenegraph/Toolbar.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
/* global process */
21
import React from 'react';
32
import classNames from 'classnames';
43
import Events from '../../lib/Events';
54
import { saveBlob } from '../../lib/utils';
5+
import GLTFIcon from '../../../assets/gltf.svg';
66

77
function filterHelpers(scene, visible) {
88
scene.traverse((o) => {
@@ -123,13 +123,7 @@ export default class Toolbar extends React.Component {
123123
title="Export to GLTF"
124124
onClick={this.exportSceneToGLTF}
125125
>
126-
<img
127-
src={
128-
process.env.NODE_ENV === 'production'
129-
? 'https://aframe.io/aframe-inspector/assets/gltf.svg'
130-
: '../assets/gltf.svg'
131-
}
132-
/>
126+
<img src={GLTFIcon} />
133127
</a>
134128
<a
135129
className={watcherClassNames}

webpack.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ module.exports = {
2727
loader: 'babel-loader'
2828
}
2929
},
30+
{
31+
test: /\.svg$/,
32+
type: 'asset/inline'
33+
},
3034
{
3135
test: /\.css$/,
3236
use: ['style-loader', 'css-loader', 'postcss-loader']

0 commit comments

Comments
 (0)