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');
|
2020-04-27 17:18:08 -04:00
|
|
|
const VueLoaderPlugin = require('vue-loader/lib/plugin')
|
2017-02-03 10:55:11 -05:00
|
|
|
|
|
|
|
build.sass.setConfig({
|
2020-04-27 17:18:08 -04:00
|
|
|
sassMatch: []
|
2017-02-03 10:55:11 -05:00
|
|
|
});
|
|
|
|
|
2020-04-27 17:18:08 -04: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
|
|
|
});
|
|
|
|
|
2020-04-27 17:18:08 -04: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
|
|
|
});
|
2017-10-09 04:44:26 -04:00
|
|
|
build.task('copy-other-files', copyOtherFiles);
|
|
|
|
build.rig.addPostTypescriptTask(copyOtherFiles);
|
2017-02-03 10:55:11 -05:00
|
|
|
|
|
|
|
build.initialize(gulp);
|