Closed sharonlx closed 6 years ago
url-loader配置:
{ test: /\.(jpg|png|gif|ttf|woff|woff2|eot|svg)$/, use: [{ loader: 'url-loader', options: { limit: '10', name: '[path][name]-[hash:10].[ext]' } }] }
index.js中的
var regString = filename .replace('\[name\]', '(\\S+)') .replace('\[ext\]', ext.substr(1, ext.length)) .replace('\[chunkhash:' + hashLength + '\]', '\\w{' + hashLength + '}') .replace('\[contenthash:' + hashLength + '\]', '\\w{' + hashLength + '}') .replace('\[hash:' + hashLength + '\]', '\\w{' + hashLength + '}'); var matches = item.match(new RegExp(regString));
matches 结果不对。
测试case item="kuaishou/static/xxx/big-smart-1234567890.png";
replace-hash-webpack-plugin@2.4.2
url-loader配置:
index.js中的
matches 结果不对。
测试case item="kuaishou/static/xxx/big-smart-1234567890.png";