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

52 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');
const VueLoaderPlugin = require('vue-loader/lib/plugin')
2017-02-03 10:55:11 -05:00
build.sass.setConfig({
sassMatch: []
2017-02-03 10:55:11 -05:00
});
build.configureWebpack.mergeConfig({
additionalConfiguration: (generatedConfiguration) => {
generatedConfiguration.plugins.push(new VueLoaderPlugin());
generatedConfiguration.resolve.alias = {
'vue$': 'vue/dist/vue.esm.js'
};
generatedConfiguration.module.rules.push({
test: /\.vue$/,
use: [
{
loader: 'vue-loader',
options: {
esModule: true
}
}]
});
generatedConfiguration.module.rules.push({
test: /\.scss$/,
use: [
'vue-style-loader',
'css-loader',
'sass-loader'
]
});
return generatedConfiguration;
}
2017-02-03 10:55:11 -05:00
});
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);