Open qianjunsteve opened 7 years ago
问题:在使用loader的情况下,对css和js添加domain,输入地址有问题,麻烦告诉解决方案,谢谢;
var loader = fis.plugin('loader', { allInOne: { js: function (file) { if (file.isCdn === true) { return '/' + fis.get('name') + '/' + file.filename + 'aio.js'; } return '/' + fis.get('name') + '/unrelease' + file.filename + '_aio.js'; }, css: function (file) { if (file.isCdn === true) { return '/' + fis.get('name') + '/' + file.filename + 'aio.css'; } return '/' + fis.get('name') + '/unrelease' + file.filename + '_aio.css'; }, includeAsyncs: true, useTrack: false }, resourceType: 'amd' });
fis.media('deploy').match('**.js', { optimizer: fis.plugin('uglify-js', { compress: { drop_console: true, drop_debugger: true, dead_code: true } }), domain : '//sec.resource.xiaomi.net/apm/hd' });
问题:在使用loader的情况下,对css和js添加domain,输入地址有问题,麻烦告诉解决方案,谢谢;
loader配置:
var loader = fis.plugin('loader', { allInOne: { js: function (file) { if (file.isCdn === true) { return '/' + fis.get('name') + '/' + file.filename + 'aio.js'; } return '/' + fis.get('name') + '/unrelease' + file.filename + '_aio.js'; }, css: function (file) { if (file.isCdn === true) { return '/' + fis.get('name') + '/' + file.filename + 'aio.css'; } return '/' + fis.get('name') + '/unrelease' + file.filename + '_aio.css'; }, includeAsyncs: true, useTrack: false }, resourceType: 'amd' });
domain配置:
fis.media('deploy').match('**.js', { optimizer: fis.plugin('uglify-js', { compress: { drop_console: true, drop_debugger: true, dead_code: true } }), domain : '//sec.resource.xiaomi.net/apm/hd' });
输出: