作者:vvdjiechipi48_2a247d | 来源:互联网 | 2023-09-13 00:48
123456789101112131415161718192021222324252627282930313233var webpack = require("webpack");module.exp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| 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
1 2 3 4 5
| this.$http.get("../data/slide.json",{}).then((response) =>{
console.log(response)
}).catch(function(){
}) |
打包的时候为什么 build文件夹下, webpack没有给我新建json文件啊?
难道还要配置什么吗?