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

46 lines
1.2 KiB
JavaScript

'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'
}
},
module: {
rules: [
{
test: /\.vue$/,
use: [
{
loader: 'vue-loader',
options: {
esModule: true
}
}]
}]
},
};
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))
});
build.task('copy-other-files', copyOtherFiles);
build.rig.addPostTypescriptTask(copyOtherFiles);
build.initialize(gulp);