Subscribe on changes!

Ignore a script file in index.html when building

avatar
May 10th 2020

Hi. Thank you for this one.

I am trying to add materializecss to my vite app by just adding the stylesheet and script src in index.html. It works well in development but when building, materializecss gives an error:

materialize.min.js:6 Uncaught TypeError: Cannot use 'in' operator to search for 'Array' in undefined
    at Object.$jscomp.polyfill (materialize.min.js:6)
    at materialize.min.js:6

When I checked the index.html file inside dist folder, I noticed that vite also included it in the build. Is there an option to skip this one? Thank you.

Here's a sample repo: https://github.com/sorxrob/vite-coil-simulator and here's the deployed app https://vitecoil-ge8gjal1x.now.sh/

Any help would be much appreciated.