Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
xqz
/
dianDemo
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
63384774
authored
2019-06-06 15:04:57 +0800
by
406803045
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
babel
1 parent
0eb93784
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
15 deletions
src/main.js
src/router/index.js
vue.config.js
src/main.js
View file @
6338477
import
Vue
from
'vue'
import
'normalize.css/normalize.css'
// A modern alternative to CSS resets
import
'@/assets/css/index.scss'
// global css
...
...
src/router/index.js
View file @
6338477
...
...
@@ -15,7 +15,7 @@ export const constantRoutes = [
const
createRouter
=
()
=>
new
Router
({
mode
:
'history'
,
// require service support
base
:
'/a
ntpublic
/'
,
base
:
'/a
pp
/'
,
scrollBehavior
:
()
=>
({
y
:
0
}),
routes
:
constantRoutes
})
...
...
vue.config.js
View file @
6338477
...
...
@@ -20,7 +20,9 @@ const cdn = {
// 开发环境
dev
:
{
css
:
[],
js
:
[]
js
:
[
'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.4.4/polyfill.js'
]
},
// 生产环境
build
:
{
...
...
@@ -37,7 +39,7 @@ const cdn = {
}
}
module
.
exports
=
{
publicPath
:
process
.
env
.
NODE_ENV
===
'development'
?
'/'
:
'/a
ntpublic/'
,
publicPath
:
process
.
env
.
NODE_ENV
===
'development'
?
'/'
:
'/a
pp/'
,
// 需要区分生产环境和开发环境,不然build会报错
outputDir
:
'dist'
,
assetsDir
:
'static'
,
lintOnSave
:
process
.
env
.
NODE_ENV
===
'development'
,
...
...
@@ -50,14 +52,13 @@ module.exports = {
errors
:
true
}
},
configureWebpack
:
config
=>
{
// 为生产环境修改配置...
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
// externals里的模块不打包
Object
.
assign
(
config
,
{
name
:
name
,
// entry:["@babel/polyfill", "./src/main.js"],
externals
:
externals
})
}
...
...
@@ -65,18 +66,9 @@ module.exports = {
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
}
},
// configureWebpack: {
// name: name,
// resolve: {
// alias: {
// '@': resolve('src')
// }
// }
// },
chainWebpack
(
config
)
{
config
.
plugins
.
delete
(
'preload'
)
// TODO: need test
config
.
plugins
.
delete
(
'prefetch'
)
// TODO: need test
// config.entry.app = ["babel-polyfill", resolve('src/main.js')]
// alias
config
.
resolve
.
alias
.
set
(
'@'
,
resolve
(
'src'
))
...
...
@@ -88,7 +80,6 @@ module.exports = {
*/
config
.
plugin
(
'html'
).
tap
(
args
=>
{
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
console
.
log
(
args
)
args
[
0
].
cdn
=
cdn
.
build
}
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment