Comments (4)
- 你说的注释是代码里面本来就有的
/*!xxx
格式的注释,还是说 loader allInOne 打包的时候给添加上的? 如果是第一种,我觉得 uglify 插件中,肯定有配置项去掉这部分注释,如果是第二种, 目前 loader 确实没有配置项 https://github.com/fex-team/fis3-postpackager-loader/blob/master/lib/pack.js#L127 应该像这个插件一样添加一个 fex-team/fis3-packager-map#6 - 你说的问题其实是因为你没有开启按需编译造成的编译浪费,开启按需编译即可。如下,指定编译入口文件是
*.html
然后fis编译时分析其引用的资源,深入分析。
fis.set('project.files', ['*.html']);
from fis3-postpackager-loader.
第一个问题是对于 min 希望不经过 uglify 处理,只去除注释。
关于第二个问题
你所说的“按需编译”怎么理解其逻辑,对于 js、css 的压缩处理是在单文件处理流程中进行的,那么首先要 match 对应的文件。
你的意思是不是可以这样理解,如果不显示的配置 match 这些文件,只设置入口,那么 fis 会自动分析加入 release 队列中?
但参考 fis release 流程原理,好像这种引用也是在打包流程中通过 loader 插件才会做的静态分析吧
from fis3-postpackager-loader.
文件参不参与单文件编译跟 match 无关,而是跟 project.files
这个配置项有关。默认 project.fies
是 *
,这样的话,你的项目目录下面的所有代码几乎都会参与编译,压缩,然后再packager阶段合并。实际上有很多代码是没用到的,也会参与编译,最耗时的是压缩。
所以我的建议是开启按需编译,把默认的 *
改成 *.html
这样,还是继续单文件编译期去做压缩,但是只会是用到了的文件才参与。然后到了 packager 阶段,只需要做简单拼接就够了。
我知道你希望的是,单文件编译期不压缩,在 loader 合并之后再对合并后的资源做一次压缩。其实我对这个需求的解读就是不希望做过多的没用文件的压缩。换成按需编译后,还是原来的编译流程,但是解决编译无用文件的问题。效果是差不多的。
from fis3-postpackager-loader.
是的,我是觉得在最后做统一压缩会最省时。
你说的“按需编译”我之前没有注意到,应该算是比较细节的了,如果确实如你所说那么在配置上应该要简单多了。
我先测试一下,非常的感谢!
from fis3-postpackager-loader.
Related Issues (20)
- 解决了
- [improvement]有没有考虑继续完善一下这个插件,更加智能方便一点? HOT 1
- 为什么升级插件需要全局安装之后libsass的错误又出来了,一直有这个错误? HOT 2
- css加载顺序问题 HOT 1
- <!--RESOURCEMAP_PLACEHOLDER-->定位无效
- Bug
- 混用[es6]import和require会产生两个_aio.js文件 HOT 17
- loader配合domain产生bug
- ignore清单失效 HOT 1
- 对依赖的js文件有顺序要求的,应当如何配置打包?
- css文件合并后的type依然是'js'
- 打包后,个别文件还是没有合并到一起 HOT 4
- 合并打包的js资源,能不能加个属性crossorigin的配置 HOT 1
- 请问aioPkg字段的生成逻辑是怎样的
- 打包忽略文件对css无效 HOT 1
- 与packTo合并js的功能协作问题。 HOT 3
- resourcemapWhitespace配置项缺失 HOT 2
- 设置fis.hook('amd') 依然生成 require.resourceMap()而不是 require.config()?
- 能否提供支持抽离公共js代码功能 HOT 1
- css 没有合并在一起 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fis3-postpackager-loader.