Skip to content

Commit 2165a54

Browse files
author
Albin Kerouanton
committed
Fix inability to use scss loader with Vue.js
Prior to this fix when the less loader isn't enabled, the scss loader config is rewritten by mistake, leading to this error: > Module build failed: Error: Cannot process lang="less" inside src/js/Player.vue: the less-loader is not activated. I also fix a functional test case for Vue.js. Actually, the tests check if the first error thrown by webpack is about missing less loader. But the fixtures needs these loaders in the following order: scss, sass and finally less. Since there's no other loader than the VueJs one loaded in this test case, errors should be in the same order.
1 parent efbec0d commit 2165a54

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/loaders/vue.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ module.exports = {
107107
true
108108
);
109109
} else {
110-
loaders.scss = {
110+
loaders.less = {
111111
loader: require.resolve('./vue-unactivated-loader'),
112112
options: {
113113
lang: 'less',

test/functional.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,9 @@ module.exports = {
726726
config.enableVueLoader();
727727

728728
testSetup.runWebpack(config, (webpackAssert, stats) => {
729-
expect(stats.toJson().errors[0]).to.contain('Cannot process lang="less" inside');
729+
expect(stats.toJson().errors[0]).to.contain('Cannot process lang="scss" inside');
730+
expect(stats.toJson().errors[1]).to.contain('Cannot process lang="sass" inside');
731+
expect(stats.toJson().errors[2]).to.contain('Cannot process lang="less" inside');
730732
done();
731733
}, true);
732734
});

0 commit comments

Comments
 (0)