fis icon indicating copy to clipboard operation
fis copied to clipboard

[FAQ] 怎样结合seajs开发,比如在压缩seajs的模块代码时,避免require关键子被替换

Open yangliulang opened this issue 10 years ago • 7 comments

你好,目前开展一个新项目,准备完全适应模块化开发,最好结合fis做统一部署打包优化工作,但是在前期准备工作中我遇到了压缩seajs代码是,里面的require关键词被替换了,这样导致加载出错了!!麻烦给我给指导建议和解决办法。

yangliulang avatar Nov 17 '14 08:11 yangliulang

试试 https://github.com/fex-team/fis-amd-demo 这个,目前用的 require.js,要不你尝试换成 sea.js 是否可用。

2betop avatar Nov 17 '14 08:11 2betop

配置一下压缩就可以了

//export, module, require不压缩变量名
fis.config.set('settings.optimizer.uglify-js', {
    mangle: {
        except: 'exports, module, require, define'
    }
});

hefangshi avatar Nov 17 '14 08:11 hefangshi

谢谢,解决啦

yangliulang avatar Nov 17 '14 09:11 yangliulang

你好,请问下你是怎么解决的?

qwe2539079 avatar Dec 15 '14 01:12 qwe2539079

@qwe2539079 看这条回复#issuecomment-63275511

oxUnd avatar Dec 15 '14 02:12 oxUnd

如果在使用了sea的alias配置,如何给里面的js路径添加时间戳,配置query好像只能对使用相对路径的外链脚本使用。

hxqbeyond avatar Mar 23 '15 15:03 hxqbeyond

<scr... type="text/javascript"> seajs.use([ '$', 'http://static.up360.com/...../scripts/.../jquery-ui-1.10.4.min.js', 'http://static.up360.com/...../scripts/.../jquery.fullPage.min.js', 'http://static.up360.com/...../scripts/.../login-min.js' ], function($, jqueryUi, FullPage, up360LoginV_01){ .......... }); </scr...> 如何给这样的情况 添加文件版本(md5戳)

ky2700 avatar Apr 22 '16 14:04 ky2700