Skip to content

Commit 85639ee

Browse files
committed
WIP - simple vuejs start
1 parent 3e7dffa commit 85639ee

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ module.exports = {
330330
},
331331

332332
/**
333-
* If enabled, the react preset is added to Babel:
333+
* If enabled, the react preset is added to Babel.
334+
*
334335
* https://babeljs.io/docs/plugins/preset-react/
335336
*
336337
* @returns {exports}
@@ -342,14 +343,14 @@ module.exports = {
342343
},
343344

344345
/**
345-
* If enabled, the vue-loader is added:
346-
* https://vue-loader.vuejs.org/en/
346+
* If enabled, the Vue.js loader is enabled.
347347
*
348-
* @param {object} options see https://vue-loader.vuejs.org/en/configurations/advanced.html
349-
* @return {exports}
348+
* https://github.com/vuejs/vue-loader
349+
*
350+
* @returns {exports}
350351
*/
351-
enableVueLoader(options = {}) {
352-
webpackConfig.enableVueLoader(options);
352+
enableVueJsLoader() {
353+
webpackConfig.enableVueJsLoader();
353354

354355
return this;
355356
},

lib/WebpackConfig.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ class WebpackConfig {
4545
resolve_url_loader: true
4646
};
4747
this.useLessLoader = false;
48-
this.useVueLoader = false;
49-
this.vueOptions = {};
5048
this.cleanupOutput = false;
5149
this.sharedCommonsEntryName = null;
5250
this.providedVariables = {};
5351
this.babelConfigurationCallback = function() {};
5452
this.useReact = false;
53+
this.useVueJsLoader = false;
5554
this.loaders = [];
5655
}
5756

@@ -224,9 +223,8 @@ class WebpackConfig {
224223
this.useReact = true;
225224
}
226225

227-
enableVueLoader(options) {
228-
this.useVueLoader = true;
229-
this.vueOptions = options;
226+
enableVueJsLoader() {
227+
this.useVueJsLoader = true;
230228
}
231229

232230
cleanupOutputBeforeBuild() {

lib/config-generator.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,16 @@ class ConfigGenerator {
168168
rules.push(loader);
169169
});
170170

171+
if (this.webpackConfig.useVueJsLoader) {
172+
rules.push({
173+
test: /\.vue$/,
174+
loader: 'vue-loader',
175+
options: {
176+
loaders: []
177+
}
178+
});
179+
}
180+
171181
return rules;
172182
}
173183

0 commit comments

Comments
 (0)