Open radium-v opened 4 years ago
Hi @radium-v , Is there any update on this task?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
any update on this one?
a workaround for css files could be to minify them beforehand and/or use imports with a loader that minifies them, e.g. sass-loader with scss files. webpack seems to automatically minify those files for production builds before passing the imported content string to FAST css.
for the template parts there is no such possibility as far as i know. the referenced issue #3452 provides a first version of a rollup-plugin, but i am locked to webpack due to other configurational demands.
thanks in advance :)
any update on this one?
a workaround for css files could be to minify them beforehand and/or use imports with a loader that minifies them, e.g. sass-loader with scss files. webpack seems to automatically minify those files for production builds before passing the imported content string to FAST css.
for the template parts there is no such possibility as far as i know. the referenced issue #3452 provides a first version of a rollup-plugin, but i am locked to webpack due to other configurational demands.
thanks in advance :)
You can create an AST transformer plugin in Typescript (using ts-patch
) to minify template literals. Once you come across a template literal in your transformer, you can run it through these functions: https://github.com/microsoft/fast/blob/master/build/transform-fragments.js
Thanks to @radium-v for making us aware of these useful functions in the FAST codebase. Regards
As mentioned in #3452, a Webpack-specific version of the template literals transformers would allow compressing
css
andhtml
tagged template literals in bundles. This would be a good addition for our sites packages as well as for those who usefast
in their own projects.