Created
August 3, 2018 20:29
-
-
Save loilo/c1a61e8cc70f586bbf277d1008b2bf8e to your computer and use it in GitHub Desktop.
Activate Object Spread in Templates of a Vue CLI v3 Project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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