8000 Bugfix/8.x webpack2 (#668) · vuejs/vue-loader@ef39568 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef39568

Browse files
yinheliyyx990803
authored andcommitted
Bugfix/8.x webpack2 (#668)
* adapt for webpack2 loader suffix is no longer optional in webpack2 for clarity reasons @see https://webpack.js.org/configuration/#options * fix tests, className failed in windows test className is not always start with "_"
1 parent 22fc1e3 commit ef39568

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ module.exports = function (content) {
145145
return defaultLoaders.html + '!' + rewriter + templateLoader + '?raw&engine=' + lang + '!'
146146
case 'style':
147147
loader = addCssModulesToLoader(defaultLoaders.css, part, index)
148-
return loader + '!' + rewriter + lang + '!'
148+
return loader + '!' + rewriter + lang + '-loader' + '!'
149149
case 'script':
150150
return injectString + lang + '!'
151151
}

test/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ describe('vue-loader', function () {
306306

307307
// get local class name
308308
var className = module.computed.style().red
309-
expect(className).to.match(/^_/)
309+
expect(className).to.match(/_/)
310310

311311
// class name in style
312312
var style = [].slice.call(window.document.querySelectorAll('style')).map(function (style) {
@@ -323,7 +323,7 @@ describe('vue-loader', function () {
323323

324324
// default module + pre-processor + scoped
325325
var anotherClassName = module.computed.$style().red
326-
expect(anotherClassName).to.match(/^_/).and.not.equal(className)
326+
expect(anotherClassName).to.match(/_/).and.not.equal(className)
327327
var id = '_v-' + hash(require.resolve('./fixtures/css-modules.vue'))
328328
expect(style).to.contain('.' + anotherClassName + '[' + id + ']')
329329

0 commit comments

Comments
 (0)
0