Closed NullVoxPopuli closed 3 months ago
Found this works pretty well: https://github.com/mainmatter/ember-hbs-minifier
renaming babel.config.json to babel.config.cjs:
babel.config.json
babel.config.cjs
'use strict'; const minifier = require('ember-hbs-minifier/hbs-minifier-plugin').createRegistryPlugin; module.exports = { plugins: [ '@embroider/addon-dev/template-colocation-plugin', [ 'babel-plugin-ember-template-compilation', { targetFormat: 'hbs', transforms: [minifier({})], }, ], ['module:decorator-transforms', { runtime: { import: 'decorator-transforms/runtime' } }], ], };
Docs on transforms: https://github.com/emberjs/babel-plugin-ember-template-compilation/?tab=readme-ov-file#common-options
transforms
I kinda want to propose this behavior be default, but I don't yet know if there are any drawbacks.
The README for ember-hbs-minifier says:
Disclaimer: This is an experiment and might change in the future. Do not use this for production yet unless you understand the consequences!
which like... :shrug: it's just an AST transform.
this was implemented!
Found this works pretty well: https://github.com/mainmatter/ember-hbs-minifier
renaming
babel.config.json
tobabel.config.cjs
:Docs on
transforms
: https://github.com/emberjs/babel-plugin-ember-template-compilation/?tab=readme-ov-file#common-optionsI kinda want to propose this behavior be default, but I don't yet know if there are any drawbacks.
The README for ember-hbs-minifier says:
which like... :shrug: it's just an AST transform.