Coder Social home page Coder Social logo

Comments (5)

BelinChung avatar BelinChung commented on August 18, 2024

补充一下:
使用场景是 CodeMirror
在选择不同的代码类型的时候需要异步加载不同的代码高亮规则 JS ,类型非常多
https://github.com/codemirror/CodeMirror/tree/master/mode

//监听select的变化
$("#snippetType").on('change', function () {
    that.snippetType = $(this).val();
    var modeURL = modeURLBase.replace(/%N/g, that.snippetType);
    require.async(modeURL, function() {
         that.codeEditor.setOption("mode", that.snippetType);
    })
});

如果在头部声明依赖的话,似乎不太实际,有没有类似 autoload 的 include 功能

//通过include属性将额外的资源增加入resourceMap中
fis.config.set('settings.postpackager.autoload.include', /^\/somepath\//i);

from fis3-postpackager-loader.

2betop avatar 2betop commented on August 18, 2024

你的意思是,可以通过 glob 或者正则,命中一堆 module 然后,让他们都在 resoucemap 表里面,方便运行时异步加载?

from fis3-postpackager-loader.

BelinChung avatar BelinChung commented on August 18, 2024

@2betop 应该是这样的!

from fis3-postpackager-loader.

2betop avatar 2betop commented on August 18, 2024

了解了,马上开始实现。

from fis3-postpackager-loader.

2betop avatar 2betop commented on August 18, 2024

[email protected]

已支持此功能,注意文档中的说明。

from fis3-postpackager-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.