sp-dev-fx-webparts/tutorials/tutorial-getting-started/documentcardexample-webpart/gulpfile.js

23 lines
639 B
JavaScript
Raw Normal View History

'use strict';
const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');
build.configureWebpack.mergeConfig({
additionalConfiguration: (generatedConfiguration) => {
if (build.getConfig().production) {
var basePath = build.writeManifests.taskConfig.cdnBasePath;
if (!basePath.endsWith('/')) {
basePath += '/';
}
generatedConfiguration.output.publicPath = basePath;
}
else {
generatedConfiguration.output.publicPath = "/dist/";
}
return generatedConfiguration;
}
});
build.initialize(gulp);