diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index f312da3e6..fbfbf23bc 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -11,7 +11,8 @@ const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin'); const eslintFormatter = require('react-dev-utils/eslintFormatter'); const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); const ParallelUglifyPlugin = require('webpack-parallel-uglify-plugin'); -const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); +// const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); +// const TerserPlugin = require('terser-webpack-plugin'); const paths = require('./paths'); const getClientEnvironment = require('./env'); @@ -55,6 +56,10 @@ const extractTextPluginOptions = shouldUseRelativeAssetPaths // 上线用的 // console.log('publicPath ', publicPath) module.exports = { + // optimization: { + // minimize: true, + // minimizer: [new TerserPlugin()], + // }, // externals: { // 'react': 'window.React' // }, @@ -372,7 +377,7 @@ module.exports = { // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack // You can remove this if you don't use Moment.js: new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), - new MonacoWebpackPlugin(), + // new MonacoWebpackPlugin(), ], // Some libraries import Node modules but don't use them in the browser. // Tell Webpack to provide empty mocks for them so importing them works. diff --git a/public/react/src/modules/developer/quillEditor/index.js b/public/react/src/modules/developer/quillEditor/index.js index e7fe026e9..da8fda7d1 100644 --- a/public/react/src/modules/developer/quillEditor/index.js +++ b/public/react/src/modules/developer/quillEditor/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-25 09:46:03 * @LastEditors: tangjiang - * @LastEditTime: 2019-11-27 19:28:50 + * @LastEditTime: 2019-11-29 14:45:27 */ import 'quill/dist/quill.core.css'; import 'quill/dist/quill.bubble.css'; @@ -38,7 +38,6 @@ const defaultOptions = [ * @description 抽取一个React编辑器组件,基于Quill * @class QuillEditor类 * @param [object] props 接收的属性 - * * props: { * options: {} // 编辑器配置信息, 不传使用 defaultOptions, 传了的话 使用用户自定义的, * placeholder: '' // 编辑器提示信息 @@ -71,7 +70,7 @@ class QuillEditor extends React.Component { toolbar: renderOptions }, readOnly, - theme: 'snow', + theme: readOnly ? 'bubble' : 'snow', } // 实例化 Quill 编辑器 quillEditor = new Quill(this.editorRef.current, editorOption); @@ -122,12 +121,15 @@ class QuillEditor extends React.Component { render () { const styles = this.props.style || {} return ( -