Skip to content

Commit

Permalink
fix: svg don't work
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Mar 24, 2018
1 parent fb49056 commit 89d2245
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 94 deletions.
3 changes: 3 additions & 0 deletions .webpackrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ export default {
alias: {
themes: resolve(__dirname, './src/themes'),
},
urlLoaderExcludes: [
/\.svg$/,
],
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.7.0",
"less-vars-to-js": "^1.1.2"
"less-vars-to-js": "^1.1.2",
"svg-sprite-loader": "^3.7.3"
},
"pre-commit": [
"lint"
Expand Down
4 changes: 2 additions & 2 deletions src/pages/chart/ECharts/theme/macarons.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
if (typeof define === 'function' && define.amd) { // eslint-disable-line
// AMD. Register as an anonymous module.
define(['exports', 'echarts'], factory)
define(['exports', 'echarts'], factory) // eslint-disable-line
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
// CommonJS
factory(exports, require('echarts'))
Expand Down
2 changes: 1 addition & 1 deletion src/pages/user/components/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'
import moment from 'moment'
import { FilterItem } from 'components'
import { Form, Button, Row, Col, DatePicker, Input, Cascader, Switch } from 'antd'
import city from '../../utils/city'
import city from 'utils/city'

const { Search } = Input
const { RangePicker } = DatePicker
Expand Down
2 changes: 1 addition & 1 deletion src/pages/user/components/Modal.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import { Form, Input, InputNumber, Radio, Modal, Cascader } from 'antd'
import city from '../../utils/city'
import city from 'utils/city'

const FormItem = Form.Item

Expand Down
89 changes: 0 additions & 89 deletions src/router.js

This file was deleted.

13 changes: 13 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

export default function (webpackConfig) {
webpackConfig.module.rules.push({
test: /\.svg$/i,
use: [
{
loader: require.resolve('svg-sprite-loader'),
},
],
})

return webpackConfig
};

0 comments on commit 89d2245

Please sign in to comment.