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

useSameNameRequire=true时会提前加载require.async声明的模块样式 #36

Open
fancyboynet opened this issue May 3, 2016 · 5 comments

Comments

@fancyboynet
Copy link

fis-config.js

fis.match('/node_modules/**.js', {
    isMod: true,
    useSameNameRequire: true
});

fis.match('/components/**.js', {
    isMod: true,
    useSameNameRequire: true
});

fis.match('/page/**', {
    isMod: true,
    useSameNameRequire: true
});

业务逻辑:

if(false){
        require.async('app/header-download/header-download'); 
    }

结果页面按预期的没有加载app/header-download/header-download.js,
却会预先加载'app/header-download/header-download.css'

@2betop
Copy link
Contributor

2betop commented May 3, 2016

请提供可复现的包。

@fancyboynet
Copy link
Author

fancyboynet commented May 3, 2016

直接在项目上测试的,干净的demo暂时没有,我把useSameNameRequire设为false就不会加载css了

fis.match('/components/**.js', {
    isMod: true,
    useSameNameRequire: false
});

useSameNameRequire=true的时候有区分分require和require. async的情况吗

@2betop
Copy link
Contributor

2betop commented May 3, 2016

对了, fis 里面处理异步 css 是自动把它变成同步的。只有 js 才会异步去加载,目的是防止页面抖动。

@fancyboynet
Copy link
Author

好吧,那就是了,个人认为做个配置是不是更合理些呢

@2betop
Copy link
Contributor

2betop commented May 3, 2016

嗯,这个可以有。

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

2 participants