sp-dev-fx-webparts/samples/vuejs-todo-single-file-comp.../gulpfile.js

46 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-02-03 10:55:11 -05:00
'use strict';
const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');
var merge = require('webpack-merge');
build.sass.setConfig({
sassMatch: []
});
build.configureWebpack.setConfig({
additionalConfiguration: function (config) {
var vueConfig = {
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
},
2017-02-03 10:55:11 -05:00
module: {
rules: [
2017-02-03 10:55:11 -05:00
{
test: /\.vue$/,
use: [
{
loader: 'vue-loader',
options: {
esModule: true
}
}]
}]
2017-02-03 10:55:11 -05:00
},
};
return merge(config, vueConfig);
}
});
let copyOtherFiles = build.subTask('copy-other-files', function(gulp, buildOptions, done){
return gulp.src(['src/**/*.vue', 'src/**/*.scss'])
.pipe(gulp.dest(buildOptions.libFolder))
2017-02-03 10:55:11 -05:00
});
build.task('copy-other-files', copyOtherFiles);
build.rig.addPostTypescriptTask(copyOtherFiles);
2017-02-03 10:55:11 -05:00
build.initialize(gulp);