我在react组件里面引入图片或是css背景图片这种,用webpack打包出来,路径总是不对 entry:'./src/entry.js',output:{ path:__dirname + '/assest/', filename:'app.js', publicPath:'/temp/assest'},module:{ loaders:[ { test: /\.js?$/, exclude: /(node_modules|bower_components)/, loader: 'babel', query: { presets: ['es2015', 'react','stage-1','stage-2','stage-3'] } }, { test:/\.less$/, loader: extractTextWebpackPlugin.extract('style-loader','css-loader!less-loader')//分离出css }, { test:/\.jpg|.png$/, loader:'file-loader?limit=5000&name=../img/[hash:8].[name].[ext]' }, { test:/\.html$/, loader:'html-loader' } ]},这个是webpack的简单配置,还请指教这图片路径的问题怎么去弄呢
添加回答
举报
0/150
提交
取消