{
test:/\.(ttf|eot|svg|woff|woff2|otf)$/,
use: 'url-loader'
}
static目录下文件不会进行打包, 所以要进行一项copy操作.
const CopyWebpackPlugin = require('copy-webpack-plugin');
plugins:[
new CopyWebpackPlugin ({
patterns: [{
from: path.resolve(__dirname, '../static'),
to: path.resolve(__dirname, '../dist/static')
}]
})
]
之前学习copywebpack的时候会报一个这个错, 是因为没写patterns, 要把patterns写上