Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loader配合domain产生bug #84

Open
qianjunsteve opened this issue Jan 20, 2017 · 0 comments
Open

loader配合domain产生bug #84

qianjunsteve opened this issue Jan 20, 2017 · 0 comments

Comments

@qianjunsteve
Copy link

qianjunsteve commented Jan 20, 2017

问题:在使用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'
});

输出:

<script type="text/javascript" src="../sec.resource.xiaomi.net/apm/hd/apm-h5-cdn/single-app_aio_757310a.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant