Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄瑜
VueElementTemplate
Commits
073b7219
Commit
073b7219
authored
Nov 23, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore:refine build:prod
parent
98604af1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
utils.js
build/utils.js
+2
-1
webpack.prod.conf.js
build/webpack.prod.conf.js
+15
-5
No files found.
build/utils.js
View file @
073b7219
...
...
@@ -21,7 +21,8 @@ exports.cssLoaders = function (options) {
}
var
postcssLoader
=
{
loader
:
'postcss-loader'
loader
:
'postcss-loader'
,
sourceMap
:
options
.
sourceMap
}
// generate loader string to be used with extract text plugin
...
...
build/webpack.prod.conf.js
View file @
073b7219
...
...
@@ -82,7 +82,7 @@ var webpackConfig = merge(baseWebpackConfig, {
// split vendor js into its own file
new
webpack
.
optimize
.
CommonsChunkPlugin
({
name
:
'vendor'
,
minChunks
:
function
(
module
,
count
)
{
minChunks
:
function
(
module
)
{
// any required modules inside node_modules are extracted to vendor
return
(
module
.
resource
&&
...
...
@@ -93,6 +93,12 @@ var webpackConfig = merge(baseWebpackConfig, {
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new
webpack
.
optimize
.
CommonsChunkPlugin
({
name
:
'manifest'
,
minChunks
:
Infinity
}),
// split echarts into its own file
new
webpack
.
optimize
.
CommonsChunkPlugin
({
async
:
'echarts'
,
...
...
@@ -109,12 +115,16 @@ var webpackConfig = merge(baseWebpackConfig, {
return
context
&&
(
context
.
indexOf
(
'xlsx'
)
>=
0
);
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new
webpack
.
optimize
.
CommonsChunkPlugin
({
name
:
'manifest'
,
chunks
:
[
'vendor'
]
name
:
'app'
,
async
:
'vendor-async'
,
children
:
true
,
minChunks
:
3
}),
// copy custom static assets
new
CopyWebpackPlugin
([{
from
:
path
.
resolve
(
__dirname
,
'../static'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment