From 084bf3d8fb08e15e56bbf8c2b4b545963b86d38b Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 7 Mar 2018 00:21:05 -0500 Subject: [PATCH] feat: use more sensible default localIdentName for css modules --- lib/helpers.js | 2 +- test/test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/helpers.js b/lib/helpers.js index dba93e06b..2367acea7 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -238,7 +238,7 @@ module.exports = function createHelpers ( modules: true } const OPTIONS = { - localIdentName: '[hash:base64]', + localIdentName: '[local]_[hash:base64:8]', importLoaders: 1 } return loader.replace(/((?:^|!)css(?:-loader)?)(\?[^!]*)?/, (m, $1, $2) => { diff --git a/test/test.js b/test/test.js index eaa64b391..377c3b0c9 100644 --- a/test/test.js +++ b/test/test.js @@ -618,7 +618,7 @@ describe('vue-loader', () => { }) } // default localIdentName - testWithIdent(undefined, /^\w{22}/, () => { + testWithIdent(undefined, /^red_\w{8}/, () => { // specified localIdentName const ident = '[path][name]---[local]---[hash:base64:5]' const regex = /css-modules---red---\w{5}/