sp-dev-fx-webparts/samples/react-calendar-feed/gulpfile.js

54 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-06-07 07:09:40 -04:00
'use strict';
const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');
const path = require('path');
2018-06-07 07:09:40 -04:00
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);
2020-07-14 18:25:11 -04:00
let needIESupport = true;
if (!!process.argv && process.argv.length > 0) {
needIESupport = process.argv.findIndex(item => '--noie11' === item.toLowerCase()) === -1;
2020-07-14 18:25:11 -04:00
}
if (needIESupport) {
const ie11BabeLoader = {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env',
{
targets: {
"ie": "11"
}
}
]
]
}
};
2020-07-15 16:48:40 -04:00
//process.stdout.write(`Adding babel-loader to support IE11 \n`);
2020-07-14 18:25:11 -04:00
build.configureWebpack.mergeConfig({
additionalConfiguration: (generatedConfiguration) => {
generatedConfiguration.module.rules.push({
test: /\.js$/,
/*
2020-07-15 16:48:40 -04:00
This selector increase the webpack(gulp serve) time 5 times then without
exclude: [/node_modules\/(?!(rss-parser))/],
*/
include: [
path.resolve(__dirname, "node_modules/rss-parser"),
],
use: [ie11BabeLoader]
2020-07-14 18:25:11 -04:00
});
2020-07-14 18:25:11 -04:00
return generatedConfiguration;
}
});
} else {
process.stdout.write(`No IE11 Support is set \n`);
2020-07-14 18:25:11 -04:00
}
2020-07-11 17:28:44 -04:00
2018-06-07 07:09:40 -04:00
build.initialize(gulp);