var webpack = require("webpack");
module.exports = {
entry : {
index : __dirname+"/src/index.js"
},
output : {
path : __dirname+"/build",
filename : "bundle.js"
},
module : {
loaders : [
{
test : /.vue$/,
loader: 'vue-loader'
},
{
test: /\.(png|jpg)$/,
loader: 'url-loader?limit=1024&name=images/[hash:8].[name].[ext]'
},
{
test : /\.json$/,
loader : 'json-loader'
}
]
},
resolve: {
alias: {
'vue': 'vue/dist/vue.js'
}
}
}
已经安装了json-loader
this.$http.get("../data/slide.json",{}).then((response) =>{
console.log(response)
}).catch(function(){
})
打包的时候为什么 build文件夹下, webpack没有给我新建json文件啊?
难道还要配置什么吗?
慕仙森
相关分类