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
2e9a3a84
Commit
2e9a3a84
authored
Aug 07, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refine build
parent
cdebb5c0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
213 additions
and
213 deletions
+213
-213
webpack.base.conf.js
build/webpack.base.conf.js
+79
-78
webpack.dev.conf.js
build/webpack.dev.conf.js
+32
-29
webpack.prod.conf.js
build/webpack.prod.conf.js
+100
-102
index.js
config/index.js
+0
-2
index.html
index.html
+2
-2
No files found.
build/webpack.base.conf.js
View file @
2e9a3a84
var
path
=
require
(
'path'
)
;
var
utils
=
require
(
'./utils'
)
;
var
config
=
require
(
'../config'
)
;
var
vueLoaderConfig
=
require
(
'./vue-loader.conf'
)
;
var
path
=
require
(
'path'
)
var
utils
=
require
(
'./utils'
)
var
config
=
require
(
'../config'
)
var
vueLoaderConfig
=
require
(
'./vue-loader.conf'
)
function
resolve
(
dir
)
{
return
path
.
join
(
__dirname
,
'..'
,
dir
)
}
var
src
=
path
.
resolve
(
__dirname
,
'../src'
);
module
.
exports
=
{
entry
:
{
...
...
@@ -15,7 +14,7 @@ module.exports = {
output
:
{
path
:
config
.
build
.
assetsRoot
,
filename
:
'[name].js'
,
publicPath
:
process
.
env
.
NODE_ENV
!==
'development'
?
config
.
build
.
assetsPublicPath
:
config
.
dev
.
assetsPublicPath
publicPath
:
process
.
env
.
NODE_ENV
!==
'development'
?
config
.
build
.
assetsPublicPath
:
config
.
dev
.
assetsPublicPath
},
resolve
:
{
extensions
:
[
'.js'
,
'.vue'
,
'.json'
],
...
...
@@ -50,7 +49,8 @@ module.exports = {
// formatter: require('eslint-friendly-formatter')
// }
// },
{
test
:
/
\.
vue$/
,
{
test
:
/
\.
vue$/
,
loader
:
'vue-loader'
,
options
:
vueLoaderConfig
},
...
...
@@ -83,3 +83,4 @@ module.exports = {
// data: path.join(__dirname, '../src/styles/index.scss')
// },
}
build/webpack.dev.conf.js
View file @
2e9a3a84
...
...
@@ -18,7 +18,9 @@ function resolveApp(relativePath) {
module
.
exports
=
merge
(
baseWebpackConfig
,
{
module
:
{
rules
:
utils
.
styleLoaders
({
sourceMap
:
config
.
dev
.
cssSourceMap
})
rules
:
utils
.
styleLoaders
({
sourceMap
:
config
.
dev
.
cssSourceMap
})
},
// cheap-source-map is faster for development
devtool
:
'#cheap-source-map'
,
...
...
@@ -40,8 +42,9 @@ module.exports = merge(baseWebpackConfig, {
template
:
'index.html'
,
favicon
:
resolveApp
(
'favicon.ico'
),
inject
:
true
,
path
:
config
.
dev
.
staticPath
path
:
config
.
dev
.
assetsPublicPath
+
config
.
dev
.
assetsSubDirectory
}),
new
FriendlyErrorsPlugin
()
]
})
build/webpack.prod.conf.js
View file @
2e9a3a84
...
...
@@ -26,7 +26,8 @@ var webpackConfig = merge(baseWebpackConfig, {
output
:
{
path
:
config
.
build
.
assetsRoot
,
filename
:
utils
.
assetsPath
(
'js/[name].[chunkhash].js'
),
chunkFilename
:
utils
.
assetsPath
(
'js/[id].[chunkhash].js'
)
chunkFilename
:
utils
.
assetsPath
(
'js/[id].[chunkhash].js'
),
publicPath
:
config
.
build
.
assetsPublicPath
},
plugins
:
[
// http://vuejs.github.io/vue-loader/en/workflow/production.html
...
...
@@ -50,9 +51,7 @@ var webpackConfig = merge(baseWebpackConfig, {
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new
HtmlWebpackPlugin
({
filename
:
process
.
env
.
NODE_ENV
===
'testing'
?
'index.html'
:
config
.
build
.
index
,
filename
:
'index.html'
,
template
:
'index.html'
,
inject
:
true
,
favicon
:
resolveApp
(
'favicon.ico'
),
...
...
@@ -68,7 +67,7 @@ var webpackConfig = merge(baseWebpackConfig, {
minifyCSS
:
true
,
minifyURLs
:
true
},
path
:
config
.
build
.
staticPath
,
path
:
config
.
build
.
assetsPublicPath
+
config
.
build
.
assetsSubDirectory
,
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode
:
'dependency'
}),
...
...
@@ -90,7 +89,7 @@ var webpackConfig = merge(baseWebpackConfig, {
}),
// split echarts into its own file
new
webpack
.
optimize
.
CommonsChunkPlugin
({
async
:
'echarts'
,
async
:
'echarts'
,
minChunks
(
module
)
{
var
context
=
module
.
context
;
return
context
&&
(
context
.
indexOf
(
'echarts'
)
>=
0
||
context
.
indexOf
(
'zrender'
)
>=
0
);
...
...
@@ -103,13 +102,11 @@ var webpackConfig = merge(baseWebpackConfig, {
chunks
:
[
'vendor'
]
}),
// copy custom static assets
new
CopyWebpackPlugin
([
{
new
CopyWebpackPlugin
([{
from
:
path
.
resolve
(
__dirname
,
'../static'
),
to
:
config
.
build
.
assetsSubDirectory
,
ignore
:
[
'.*'
]
}
]),
}]),
new
webpack
.
ProvidePlugin
({
$
:
'jquery'
,
'jQuery'
:
'jquery'
...
...
@@ -121,3 +118,4 @@ if (config.build.bundleAnalyzerReport) {
webpackConfig
.
plugins
.
push
(
new
BundleAnalyzerPlugin
())
}
module
.
exports
=
webpackConfig
config/index.js
View file @
2e9a3a84
...
...
@@ -9,7 +9,6 @@ module.exports = {
assetsRoot
:
path
.
resolve
(
__dirname
,
'../dist'
),
assetsSubDirectory
:
'static'
,
assetsPublicPath
:
'./'
,
//请根据自己路径配置更改
staticPath
:
'./static/'
,
//请根据自己路径配置更改
productionSourceMap
:
false
,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
...
...
@@ -29,7 +28,6 @@ module.exports = {
autoOpenBrowser
:
true
,
assetsSubDirectory
:
'static'
,
assetsPublicPath
:
'/'
,
staticPath
:
'/static/'
,
proxyTable
:
{},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
...
...
index.html
View file @
2e9a3a84
...
...
@@ -8,8 +8,8 @@
<title>
Juicy
</title>
</head>
<body>
<script
src=
<%=
htmlWebpackPlugin
.
options
.
path
%
>
jquery
.
min
.
js
>
</script>
<script
src=
<%=
htmlWebpackPlugin
.
options
.
path
%
>
tinymce
/
tinymce
.
min
.
js
>
</script>
<script
src=
<%=
htmlWebpackPlugin
.
options
.
path
%
>
/
jquery
.
min
.
js
>
</script>
<script
src=
<%=
htmlWebpackPlugin
.
options
.
path
%
>
/
tinymce
/
tinymce
.
min
.
js
>
</script>
<div
id=
"app"
></div>
<!-- built files will be auto injected -->
</body>
...
...
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