Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as Webpack from 'webpack';
// @ts-ignore
import * as WebpackDevServer from 'webpack-dev-server'; // eslint-disable-line
import { WebpackTask } from './WebpackTask';
import * as path from 'path';
// Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance.
const webpackTask: WebpackTask = require('@microsoft/web-library-build').webpack;
const webpack: typeof Webpack = webpackTask.resources.webpack;
const isProduction: boolean = webpackTask.buildConfig.production;
// eslint-disable-next-line
const packageJSON: { name: string } = require('./package.json');
const webpackConfiguration: Webpack.Configuration = {
context: __dirname,
devtool: (isProduction) ? undefined : 'source-map',
entry: {
[packageJSON.name]: path.join(__dirname, webpackTask.buildConfig.libFolder, 'index.js')
},
output: {
'use strict';
/** Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance. */
let build = require('@microsoft/web-library-build');
let webpackTaskResources = build.webpack.resources;
let webpack = webpackTaskResources.webpack;
let path = require('path');
let buildConfig = build.getConfig();
let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const BUNDLE_NAME = 'experiments';
const BUNDLE_TEST = 'fabric-test';
const IS_PRODUCTION = process.argv.indexOf('--production') > -1;
// Create an array of configs, prepopulated with a debug (non-minified) build.
let configs = [
createConfig(false)
];
// Create a production config if applicable.
if (IS_PRODUCTION) {
'use strict';
let gulp = require('gulp');
let build = require('@microsoft/web-library-build');
build.task('tslint', build.tslint);
build.task('sass', build.sass);
build.task('karma', build.karma);
build.task('webpack', build.webpack);
// initialize tasks.
build.initialize(gulp);
// Always fail on test failures.
build.karma.setConfig({
failBuildOnErrors: true
});
// Copy fabric-core to dist to be published with fabric-react.
build.preCopy.setConfig({
shouldFlatten: false,
copyTo: {
[path.join(distFolder, 'sass')]: [
'node_modules/office-ui-fabric-core/dist/sass/**/*.*'
],
[path.join(distFolder, 'css')]: [
'node_modules/office-ui-fabric-core/dist/css/**/*.*'
]
}
});
// Short aliases for subtasks.
build.task('webpack', build.webpack);
build.task('tslint', build.tslint);
build.task('ts', build.typescript);
build.task('sass', build.serial(build.preCopy, build.sass));
build.task('karma', build.karma);
build.task('test', serial(build.sass, build.typescript, build.karma));
// build.task('visualtest', serial(build.sass, build.typescript, build.webpack, visualTestClean, visualTest));
// initialize tasks.
build.initialize(gulp);
'use strict';
/** Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance. */
let build = require('@microsoft/web-library-build');
let buildConfig = build.getConfig();
let webpackTaskResources = build.webpack.resources;
let webpack = webpackTaskResources.webpack;
let path = require('path');
let SplitByPathPlugin = require('webpack-split-by-path');
let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
// Create an array of configs, prepopulated with a debug (non-minified) build.
let configs = [
createConfig(false)
];
// Create a production config if applicable.
if (process.argv.indexOf('--production') > -1) {
configs.push(createConfig(true));
}
'use strict';
/** Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance. */
let build = require('@microsoft/web-library-build');
let webpackTaskResources = build.webpack.resources;
let webpack = webpackTaskResources.webpack;
let path = require('path');
let VisualizerPlugin = require('webpack-visualizer-plugin');
let buildConfig = build.getConfig();
// Create an array of configs, prepopulated with a debug (non-minified) build.
let configs = [
createConfig(false)
];
// Create a production config if applicable.
if (process.argv.indexOf('--production') > -1) {
configs.push(createConfig(true));
}
// Helper to create the config.
'use strict';
/** Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance. */
let build = require('@microsoft/web-library-build');
let buildConfig = build.getConfig();
let webpackTaskResources = build.webpack.resources;
let webpack = webpackTaskResources.webpack;
let path = require('path');
let SplitByPathPlugin = require('webpack-split-by-path');
let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const IS_PRODUCTION = process.argv.indexOf('--production') >= 0;
const BUNDLE_NAME = 'fabric-examples';
// Create an array of configs, prepopulated with a debug (non-minified) build.
let configs = [
createConfig(IS_PRODUCTION)
];
// Helper to create the config.
function createConfig(isProduction) {
let minFileNamePart = isProduction ? '.min' : '';
'use strict';
/** Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance. */
let webpackTaskResources = require('@microsoft/web-library-build').webpack.resources;
let webpack = webpackTaskResources.webpack;
let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
let isProduction = process.argv.indexOf('--production') > -1;
let isDogfood = process.argv.indexOf('--dogfood') > -1;
let path = require('path');
const version = require('./package.json').version;
let publicPath = 'https://static2.sharepointonline.com/files/fabric/fabric-website/dist/';
if (isDogfood) {
publicPath = 'https://static2df.sharepointonline.com/files/fabric/fabric-website/dist/';
} else if (!isProduction) {
publicPath = "/dist/";
}
// Create an array of configs, prepopulated with a debug (non-minified) build.
'use strict';
let path = require('path');
let build = require('@microsoft/web-library-build');
build.sass.setConfig({ useCSSModules: true });
build.webpack.setConfig({ configPath: null });
build.setConfig({
libAMDFolder: path.join(build.getConfig().packageFolder, 'lib-amd'),
libES6Folder: path.join(build.getConfig().packageFolder, 'lib-es6')
});
build.preCopy.cleanMatch = ['src/preCopyTest.ts'];
build.initialize(require('gulp'));
'use strict';
/** Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance. */
let webpackTaskResources = require('@microsoft/web-library-build').webpack.resources;
let webpack = webpackTaskResources.webpack;
let path = require('path');
let isProduction = process.argv.indexOf('--production') > -1;
let packageJSON = require('./package.json');
let webpackConfig = {
context: path.join(__dirname, 'lib/'),
entry: {
[packageJSON.name]: './index.js'
},
output: {
libraryTarget: 'umd',
path: path.join(__dirname, '/dist'),