我有下一个webpack配置。
plugins: [
new CleanWebpackPlugin(['dist']),
new HtmlWebpackPlugin()
],
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
}
],
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['es2015']
},
exclude: /node_modules/
},
构建webpack后,我收到一个错误: 您可能需要一个合适的加载程序来处理此文件类型。 在svg字符串中,它来自css文件。怎么能解决这个问题呢?
答案 0 :(得分:0)
添加 //Calculate totalPremium
String premium = order.getProposalId();
String proposal = order.getProposalId();
if(premium.equalsIgnoreCase("")){
premium = "0";
}
if(proposal.equalsIgnoreCase("")){
proposal = "0";
}
int total = 0;
for (Order order:cart)
total+=(Integer.parseInt(premium))* (Integer.parseInt(proposal));
Locale locale = new Locale("sw", "KE");
NumberFormat fmt = NumberFormat.getCurrencyInstance(locale);
txtTotalPrice.setText(fmt.format(total));
或url-loader
来处理这些扩展程序。
file-loader