Giter VIP home page Giter VIP logo

Comments (11)

oxUnd avatar oxUnd commented on May 30, 2024

release 不能设置成 false

在 2015年7月3日,下午4:40,Hanai [email protected] 写道:

// test.tpl

test

fis.match('*.tpl', {
release: false,
isHtmlLike: true
});
错误信息

[ERROR] unreleasable file [/Users/hanai/WebstormProjects/fis3-demo/use-amd/test.tpl]

Reply to this email directly or view it on GitHub #28.

from fis3.

calledT avatar calledT commented on May 30, 2024

@xiangshouding 如果要设置某些文件或者文件夹不输出到output目录要怎么配置,而且Demo的配置里有设置release为false的情况

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024
fis.match('*', {
  deploy: [function (options, modified, total, next)) {
    modified = modified.filter(function(file) {
      if (file.needCompileButNotRelease) {
        return false;
      }
      return true;
    });
    next(); // 别忘了 next();
  }, fis.plugin('local-deliver', {})]
});

fis.match('*.not.release.js', {
  needCompileButNotRelease: true
});

后续我造一个某些文件想编译但是不想产出deploy,你先用这个将就着用。

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024

@calledT 但可能这块有个误解;

{
  release: false
}

设置时,按照我们的当初的想法,都不发布了还进入编译是不合理的。进入编译的文件应该都发布。
后来很多用户反应,文件已经被打包到某个其他文件里去了,为啥还要产出。文件已经内嵌掉了为啥还要产出,所以跟一些理念冲突了。

不过我们依然觉着即使文件已经被打包了、被合并了那个文件也应该被产出。所以 release: false 依然无法做到编译但不产出。

所以需要经过 deploy 阶段进行筛选,把我需要在编译阶段出现但是不想产出的文件删掉不让它产出。

from fis3.

oxUnd avatar oxUnd commented on May 30, 2024

不过我们正在研讨这个事情,可能会让 { release: false } 的资源进入编译但不产出。

from fis3.

2betop avatar 2betop commented on May 30, 2024

release: false 我这是能被 inline 的啊,是否 fis3 的版本不是最新的导致的?我刚按你的 demo 测试了一把,没有这个 error 出现。

from fis3.

hanai avatar hanai commented on May 30, 2024

@2betop
哦,我又测试了下,看我的详细配置

fis.match('*.tpl', {
    release: false
});

// 以下
// npm install [-g] fis3-hook-module
fis.hook('module', {
    mode: 'amd'
});

fis.match('/comp/**/*.js', {
    isMod: true, // 设置 comp 下都是一些组件,组件建议都是匿名方式 define
    release: '/static/$0'
});

fis.match('::package', {
    // npm install [-g] fis3-postpackager-loader
    // 分析 __RESOURCE_MAP__ 结构,来解决资源加载问题
    postpackager: fis.plugin('loader', {
        resourceType: 'amd',
        useInlineMap: true // 资源映射表内嵌
    })
});

单独只有 *.tpl 的规则没有问题,加了后面的内容才会有这个错误

[ERROR] unreleasable file [/Users/hanai/WebstormProjects/fis3-demo/use-amd/test.tpl]

[email protected]
[email protected]
[email protected]

from fis3.

2betop avatar 2betop commented on May 30, 2024

哈哈,复现了。请更新 fis3-postpackager-loader 插件

from fis3.

xiaoyuze88 avatar xiaoyuze88 commented on May 30, 2024

@2betop

modified = modified.filter(...)

是不会起作用的...并未修改原modified的引用

from fis3.

2betop avatar 2betop commented on May 30, 2024

嗯,正确的姿势应该是 modified.splice(index, 1);

from fis3.

mayloveless avatar mayloveless commented on May 30, 2024
fis.match('*', {
  deploy: [function (options, modified, total, next)) {
    modified = modified.filter(function(file) {
      if (file.needCompileButNotRelease) {
        return false;
      }
      return true;
    });
    next(); // 别忘了 next();
  }, fis.plugin('local-deliver', {})]
});

fis.match('*.not.release.js', {
  needCompileButNotRelease: true
});

请问这个问题是否有方便的写法?比如不标示是否是release,只要是inline的文件,就不release。
或者写插件应该在什么位置写?

from fis3.

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.