mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-07-28 16:37:42 +00:00
uglify the output js, and udpate webpack to 3
This commit is contained in:
5
web/postcss.config.js
Normal file
5
web/postcss.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require('autoprefixer')
|
||||
]
|
||||
}
|
@@ -208,7 +208,7 @@ class HeaderMenu extends React.Component {
|
||||
onClick={this.stopRecording}
|
||||
>
|
||||
<div className={Style.filterIcon}>
|
||||
<InlineSVG src={require('svg-inline!assets/stop.svg')} />
|
||||
<InlineSVG src={require('svg-inline-loader!assets/stop.svg')} />
|
||||
</div>
|
||||
<span>Stop</span>
|
||||
</a>
|
||||
@@ -221,7 +221,7 @@ class HeaderMenu extends React.Component {
|
||||
onClick={this.resumeRecording}
|
||||
>
|
||||
<div className={Style.stopIcon}>
|
||||
<InlineSVG src={require('svg-inline!assets/play.svg')} />
|
||||
<InlineSVG src={require('svg-inline-loader!assets/play.svg')} />
|
||||
</div>
|
||||
<span>Resume</span>
|
||||
</a>
|
||||
@@ -234,7 +234,7 @@ class HeaderMenu extends React.Component {
|
||||
onClick={this.showFilter}
|
||||
>
|
||||
<div className={Style.stopIcon}>
|
||||
<InlineSVG src={require('svg-inline!assets/filter.svg')} />
|
||||
<InlineSVG src={require('svg-inline-loader!assets/filter.svg')} />
|
||||
</div>
|
||||
<span>Filter</span>
|
||||
</a>
|
||||
@@ -250,7 +250,7 @@ class HeaderMenu extends React.Component {
|
||||
onClick={this.clearAllRecord}
|
||||
title="Ctrl + X"
|
||||
>
|
||||
<InlineSVG src={require('svg-inline!assets/clear.svg')} />
|
||||
<InlineSVG src={require('svg-inline-loader!assets/clear.svg')} />
|
||||
<span>Clear</span>
|
||||
</a>
|
||||
{inAppMode ? filterMenu : null}
|
||||
@@ -269,7 +269,7 @@ class HeaderMenu extends React.Component {
|
||||
href="javascript:void(0)"
|
||||
>
|
||||
<div className={Style.tipIcon} >
|
||||
<InlineSVG src={require('svg-inline!assets/tip.svg')} />
|
||||
<InlineSVG src={require('svg-inline-loader!assets/tip.svg')} />
|
||||
</div>
|
||||
<span>Proxy Info</span>
|
||||
</a>
|
||||
|
@@ -93,7 +93,7 @@ class LeftMenu extends React.Component {
|
||||
title="Only show the filtered result"
|
||||
>
|
||||
<span className={Style.filterIcon}>
|
||||
<InlineSVG src={require('svg-inline!assets/filter.svg')} />
|
||||
<InlineSVG src={require('svg-inline-loader!assets/filter.svg')} />
|
||||
</span>
|
||||
<span>Filter</span>
|
||||
</a>
|
||||
@@ -105,7 +105,7 @@ class LeftMenu extends React.Component {
|
||||
title="Download the root CA to the computer and your phone"
|
||||
>
|
||||
<span className={Style.downloadIcon}>
|
||||
<InlineSVG src={require('svg-inline!assets/download.svg')} />
|
||||
<InlineSVG src={require('svg-inline-loader!assets/download.svg')} />
|
||||
</span>
|
||||
<span>RootCA</span>
|
||||
</a>
|
||||
|
@@ -3,6 +3,8 @@ const path = require('path');
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
|
||||
const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
|
||||
|
||||
const extractCss = new ExtractTextPlugin('[name].css', {
|
||||
disable: false,
|
||||
allChunks: true
|
||||
@@ -22,73 +24,91 @@ module.exports = {
|
||||
filename: 'main.js'
|
||||
},
|
||||
resolve: {
|
||||
root: path.join(__dirname, 'src'),
|
||||
extensions: ['', '.js', '.jsx']
|
||||
modules: [
|
||||
'node_modules',
|
||||
path.join(__dirname, 'src')
|
||||
],
|
||||
extensions: ['.', '.js', '.jsx']
|
||||
},
|
||||
module: {
|
||||
loaders: [{
|
||||
rules: [{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel',
|
||||
query: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['es2015', 'stage-0']
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.jsx$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel',
|
||||
query: {
|
||||
presets: ['es2015', 'stage-0', 'react'],
|
||||
plugins: ['transform-runtime', ['import', { libraryName: 'antd', style: true }]]
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['es2015', 'stage-0', 'react'],
|
||||
plugins: [['import', { libraryName: 'antd', style: true }]]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: function (filePath) {
|
||||
return (/antd\/.*\.less$/.test(filePath) || /\.global\.less$/.test(filePath));
|
||||
},
|
||||
loader: ExtractTextPlugin.extract('css!postcss!less')
|
||||
use: ExtractTextPlugin.extract({use: 'css-loader!postcss-loader!less-loader'})
|
||||
},
|
||||
{
|
||||
test: function (filePath) {
|
||||
return (/\.less$/.test(filePath) && !/\.global\.less$/.test(filePath) && !/antd\/.*\.less$/.test(filePath));
|
||||
},
|
||||
loader: ExtractTextPlugin.extract('css?modules&localIdentName=[local]___[hash:base64:5]!postcss!less')
|
||||
use: ExtractTextPlugin.extract({use: 'css-loader?modules&localIdentName=[local]___[hash:base64:5]!postcss-loader!less-loader'})
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: ExtractTextPlugin.extract('css')
|
||||
use: ExtractTextPlugin.extract({use:'css-loader'})
|
||||
},
|
||||
{
|
||||
test: /\.png(\?v=\d+\.\d+\.\d+)?$/,
|
||||
loader: 'url?limit=10000&mimetype=image/png'
|
||||
use: {
|
||||
loader: 'url-loader?limit=10000&mimetype=image/png'
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
|
||||
loader: 'url?limit=10000&mimetype=application/font-woff'
|
||||
use: {
|
||||
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
|
||||
loader: 'url?limit=10000&mimetype=application/font-woff'
|
||||
use: {
|
||||
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
|
||||
loader: 'url?limit=10000&mimetype=application/octet-stream'
|
||||
use: {
|
||||
loader: 'url-loader?limit=10000&mimetype=application/octet-stream'
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
|
||||
loader: 'url?limit=10000&mimetype=application/octet-stream'
|
||||
use: {
|
||||
loader: 'url-loader?limit=10000&mimetype=application/octet-stream'
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /font\.svg(\?v=\d+\.\d+\.\d+)?$/,
|
||||
loader: 'url?limit=10000&mimetype=image/svg+xml'
|
||||
use: {
|
||||
loader: 'url-loader?limit=10000&mimetype=image/svg+xml'
|
||||
}
|
||||
}]
|
||||
},
|
||||
postcss: function () {
|
||||
return [autoprefixer];
|
||||
},
|
||||
plugins: [
|
||||
extractCss,
|
||||
defineProperty
|
||||
]
|
||||
defineProperty,
|
||||
new UglifyJsPlugin()
|
||||
],
|
||||
stats: {
|
||||
children: false
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user