From 5f8d26175af5ee30b536fb0f7600742bcd7e2c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Mon, 12 Nov 2018 17:58:35 +0100 Subject: [PATCH] fix: Double escaping (fix #4312) --- packages/config/src/options.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/config/src/options.js b/packages/config/src/options.js index 3e064d20c6..b3331e42fe 100644 --- a/packages/config/src/options.js +++ b/packages/config/src/options.js @@ -293,6 +293,20 @@ export function getNuxtConfig(_options) { if (vueLoader.productionMode === undefined) { vueLoader.productionMode = !options.dev } + // TODO: Remove when new release of Vue (https://github.com/nuxt/nuxt.js/issues/4312) + const staticClassHotfix = function (el) { + el.staticClass = el.staticClass && el.staticClass.replace(/\\[a-z]\b/g, '') + if (Array.isArray(el.children)) { + el.children.map(staticClassHotfix) + } + } + vueLoader.compilerOptions = vueLoader.compilerOptions || {} + vueLoader.compilerOptions.modules = [ + ...(vueLoader.compilerOptions.modules || []), + { + postTransformNode: staticClassHotfix + } + ] const styleLoaders = [ 'css', 'cssModules', 'less', 'sass', 'scss', 'stylus', 'vueStyle'