Closed pYr0x closed 5 years ago
https://github.com/stealjs/steal/blob/02d018f1b03e12ed8182fcf10578403255be5d2b/src/extension-tree-shaking.js#L284 should have compact: false
var code = babel.transform(load.source, {
plugins: babelPlugins,
compact: false
}).code;
or something like this:
let opts = loader.babelOptions || {};
opts.plugins = babelPlugins;
var code = babel.transform(load.source, opts).code;
@matthewp what solution do you prefer?
We don't want to pass in the babelOptions, we are only running babel for the sake of tree-shaking there, the transpiling happens elsewhere. So the first is the way to go here.
i use fontawesome for my iconset.
if i want to create a production build i get the babel notice like in the header. after that i get an error
it seems that babel trim the content and than the content is corrupt. i searched and found https://stackoverflow.com/questions/29576341/what-does-the-code-generator-has-deoptimised-the-styling-of-some-file-as-it-e/29857361
the
@fortawesome/free-solid-svg-icons/index.es
file is about 570kb.they suggest to set
compact: false
i tried that in my package.jsonbut it didnt work.
if you need a example i can create some.