Skip to content

Instantly share code, notes, and snippets.

@loilo
Created August 3, 2018 20:29
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 loilo/c1a61e8cc70f586bbf277d1008b2bf8e to your computer and use it in GitHub Desktop.
Save loilo/c1a61e8cc70f586bbf277d1008b2bf8e to your computer and use it in GitHub Desktop.
Activate Object Spread in Templates of a Vue CLI v3 Project
// Store this as vue.config.js in your project root
// to enable object spread in templates.
// Note that you'll need to provide an Object.assign()
// polyfill for legacy browsers.
module.exports = {
chainWebpack: config => {
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
return {
...options,
transpileOptions: {
...(options.transpileOptions || {}),
objectAssign: 'Object.assign'
}
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment