Rich-text Reply
Highlighted

Confused why compiled Webpack output files have so many validation errors?

thomas-davis 2w ago
Accepted Solution

Confused why compiled Webpack output files have so many validation errors?

[ Edited ]

I'm having issues adding compiled Webpack output files to the variation code editor. I'm getting is not a u'javascript_string' when it clearly is. Also if I un-minify I get errors related to missing semicolons. I'm not sure how the code is being evaluated. It would be nice to have something like eslinter comments to ignore these errors.

pbs 2w ago
 

Re: Confused why compiled Webpack output files have so many validation errors?

Hi there -

 

The following script will ignore any front end errors, so may be sufficient. It will not ignore any backend checks, however:

 

/* jshint ignore:start */
// Code here will be ignored by JSHint.
/* jshint ignore:end */
pbs
Optimizely
thomas-davis a week ago
 

Re: Confused why compiled Webpack output files have so many validation errors?

Thanks for the response, 

 

Unfortunately this didn't fix the issue as I'm pushing the code to Optimizely through the REST API. However, I was able to get it to work by using the babel-minify-webpack-plugin and preventing the default minifier in Webpack.