Skip to content

Instantly share code, notes, and snippets.

@lacostenycoder
Created April 29, 2019 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lacostenycoder/9710abc8cb1b5db5e219af0181e22e41 to your computer and use it in GitHub Desktop.
Save lacostenycoder/9710abc8cb1b5db5e219af0181e22e41 to your computer and use it in GitHub Desktop.
Fix vue.js no parser error
#!/usr/bin/env ruby
# goto the root of your application before running this script
filename = 'node_modules/vue-loader/lib/template-compiler/index.js'
text = File.read(filename)
new_code = %q(code = prettier.format(code, { semi: false, parser: 'babel' }))
old_code = 'code = prettier.format(code, { semi: false })'
replace = text.gsub(old_code, new_code)
unless old_code == new_code
File.write(filename, replace)
end
@lacostenycoder
Copy link
Author

Solution to webpacker errors when using vue.js in rails based on this answer on stackoverflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment