diff --git a/src/js/api.js b/src/js/api.js index 8f6a8eff6..8fd09a383 100644 --- a/src/js/api.js +++ b/src/js/api.js @@ -3,7 +3,7 @@ import axios from 'axios'; export default { send: (options) => { axios - .post(options.url, options.data) + .post(options.url, options.data, { timeout: 10000 }) .then((response) => { const data = response.data; if (!data || data.code !== 0) { @@ -20,7 +20,7 @@ export default { read: (options) => { axios - .get(options.url) + .get(options.url, { timeout: 10000 }) .then((response) => { const data = response.data; if (!data || data.code !== 0) { diff --git a/webpack/prod.config.js b/webpack/prod.config.js index 682bf9017..220044c4b 100644 --- a/webpack/prod.config.js +++ b/webpack/prod.config.js @@ -1,6 +1,7 @@ const path = require('path'); const webpack = require('webpack'); const { GitRevisionPlugin } = require('git-revision-webpack-plugin'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const gitRevisionPlugin = new GitRevisionPlugin(); module.exports = { @@ -54,7 +55,7 @@ module.exports = { { test: /\.less$/, use: [ - 'style-loader', + MiniCssExtractPlugin.loader, { loader: 'css-loader', options: { @@ -91,6 +92,9 @@ module.exports = { }, plugins: [ + new MiniCssExtractPlugin({ + filename: '[name].min.css', + }), new webpack.DefinePlugin({ DPLAYER_VERSION: `"${require('../package.json').version}"`, GIT_HASH: JSON.stringify(gitRevisionPlugin.version()),