Skip to content

Commit bfd95d6

Browse files
author
Sven
committed
chore: 优化构建
1 parent 13dfb3b commit bfd95d6

File tree

4 files changed

+1
-24
lines changed

4 files changed

+1
-24
lines changed

build/scripts/compile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const compile = () => Promise.resolve()
4444
logger.log(stats.toString({
4545
colors: true,
4646
chunks: false,
47+
modules: false
4748
}))
4849
}
4950
logger.success(`Compiler finished successfully! See ./${project.outDir}.`)

build/webpack.config.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const webpack = require('webpack')
33
const HtmlWebpackPlugin = require('html-webpack-plugin')
44
const ExtractTextPlugin = require('extract-text-webpack-plugin')
55
const project = require('../project.config')
6-
const CompressionWebpackPlugin = require('compression-webpack-plugin')
76

87
const inProject = path.resolve.bind(path, project.basePath)
98
const inProjectSrc = (file) => inProject(project.srcDir, file)
@@ -196,15 +195,6 @@ if (__PROD__) {
196195
join_vars: true,
197196
drop_console: true,
198197
},
199-
}),
200-
new CompressionWebpackPlugin({ // gzip 压缩
201-
asset: '[path].gz[query]',
202-
algorithm: 'gzip',
203-
test: new RegExp(
204-
'\\.(js|css|html)$' // 压缩 js 与 css
205-
),
206-
threshold: 10240,
207-
minRatio: 0.8
208198
})
209199
)
210200
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"babel-preset-react": "^6.24.1",
5656
"babel-runtime": "^6.26.0",
5757
"chalk": "^2.1.0",
58-
"compression-webpack-plugin": "^1.0.0",
5958
"cross-env": "^5.0.5",
6059
"css-loader": "^0.28.5",
6160
"eslint": "^4.5.0",

yarn.lock

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,6 @@ async@2.1.4:
214214
dependencies:
215215
lodash "^4.14.0"
216216

217-
async@2.4.1:
218-
version "2.4.1"
219-
resolved "https://registry.yarnpkg.com/async/-/async-2.4.1.tgz#62a56b279c98a11d0987096a01cc3eeb8eb7bbd7"
220-
dependencies:
221-
lodash "^4.14.0"
222-
223217
async@^2.1.2, async@^2.1.5, async@^2.4.1:
224218
version "2.5.0"
225219
resolved "https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d"
@@ -1313,13 +1307,6 @@ compressible@~2.0.10:
13131307
dependencies:
13141308
mime-db ">= 1.29.0 < 2"
13151309

1316-
compression-webpack-plugin@^1.0.0:
1317-
version "1.0.0"
1318-
resolved "https://registry.yarnpkg.com/compression-webpack-plugin/-/compression-webpack-plugin-1.0.0.tgz#5c5eb6afd08ca6a5d66006eeef71da17b01bd676"
1319-
dependencies:
1320-
async "2.4.1"
1321-
webpack-sources "^1.0.1"
1322-
13231310
compression@^1.6.2:
13241311
version "1.7.0"
13251312
resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.0.tgz#030c9f198f1643a057d776a738e922da4373012d"

0 commit comments

Comments
 (0)