webpack-encore
webpack-encore copied to clipboard
How can I transpileDependencies when using webpack encore
Hi,
In my Symfony/VueJS/Vuetify project I am trying to use package vuetify tiptap WYSIWYG-editor. However, here: https://github.com/iliyaZelenko/tiptap-vuetify/issues/248#issuecomment-749354197 I can read that I need to add:
transpileDependencies: [ /[\\/]node_modules[\\/]tiptap.*/ ],
to module.exports in "config.vue.js". But this file is only parsed if using vue-cli -- which I am not.
Could someone help me figure out the syntax for adding transpilingDependencies to webpack.config.js?
Thanks in advance!
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?
Seem like it is still the same behavior -- ie: the dependencies are not transpiled.
Option transpileDependencies from Vue CLI is a shortcut for configuring exclude rule option, see https://github.com/vuejs/vue-cli/blob/f0f254e4bc81ed322eeb9f7de346e987e845068e/packages/%40vue/cli-plugin-babel/index.js#L36-L96.
With Webpack Encore, if you configure Babel through Encore.configureBabel(), then you must use something like this:
Encore.configureBabel(() => {}, {
exclude: /node_modules\/(?!(tiptap.*)\/)/
});
It will continue to exclude files from node_modules/ directory except files from node_modules/tipap/