Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0ef28be

Browse files
committed
update config
1 parentd33b2c2 commit0ef28be

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

‎template/build/webpack.dev.config.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,29 @@ devConfig.devServer = {
1919
hot:true,
2020
noInfo:false,
2121
quite:false,
22-
port:3000,
22+
port:config.dev.port,
2323
debug:true,
2424
inline:true,
2525
progress:true,
2626
historyApiFallback:true,
2727
colors:true,
2828
stats:'normal',
29-
contentBase:'/',
30-
publicPath:"/"
29+
contentBase:config.dev.assetsPublicPath,
30+
publicPath:config.dev.assetsPublicPath
3131
};
3232

3333
module.exports=Object.assign({},devConfig,{
3434
entry:{
3535
app:[
3636
"webpack/hot/dev-server",
37-
"webpack-dev-server/client?http://localhost:3000/",
37+
`webpack-dev-server/client?http://localhost:${config.dev.port}/`,
3838
path.resolve(__dirname,'../src/index.js')
3939
]
4040
},
4141
output:{
4242
filename:'[name].js',
43-
path:path.resolve(__dirname,'../assets/'),
44-
publicPath:"/",
43+
path:config.dev.assetsRoot,
44+
publicPath:config.dev.assetsPublicPath,
4545
sourceMapFilename:'[file].map'
4646
},
4747
devtool:'#cheap-module-eval-source-map'

‎template/build/webpack.prod.config.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let config = require('../config');
99
prodConfig.plugins=(prodConfig.plugins||[]).concat([
1010
newwebpack.optimize.DedupePlugin(),
1111
newwebpack.DefinePlugin({
12-
'process.env':config.prod.env
12+
'process.env':config.build.env
1313
}),
1414
newwebpack.optimize.UglifyJsPlugin({
1515
compress:{
@@ -29,8 +29,8 @@ module.exports = Object.assign({},prodConfig,{
2929
},
3030
output:{
3131
filename:'[name].js',
32-
path:path.resolve(__dirname,'../assets/'),
33-
publicPath:'/',
32+
path:config.build.assetsRoot,
33+
publicPath:config.build.assetsPublicPath,
3434
sourceMapFilename:'[file].map'
3535
},
3636
devtool:'#source-map'

‎template/config/index.js‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ let path = require('path');
44

55
module.exports={
66
dev:{
7-
env:require('./dev.env.js')
7+
env:require('./dev.env.js'),
8+
assetsRoot:path.resolve(__dirname,'../dist'),
9+
assetsPublicPath:'/',
10+
assetsSubDirectory:'static',
11+
port:3000
812
},
9-
prod:{
10-
env:require('./prod.env.js')
13+
build:{
14+
env:require('./prod.env.js'),
15+
assetsRoot:path.resolve(__dirname,'../dist'),
16+
assetsPublicPath:'/',
17+
assetsSubDirectory:'static'
1118
}
1219
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp