Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
configFile: options.tsConfig,
extensions,
mainFields,
}),
],
mainFields,
},
performance: {
hints: false,
},
plugins: [
new ForkTsCheckerWebpackPlugin({
tsconfig: options.tsConfig,
useTypescriptIncrementalApi: options.useTypescriptIncrementalApi,
workers: options.useTypescriptIncrementalApi
? ForkTsCheckerWebpackPlugin.ONE_CPU
: options.maxWorkers || ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
}),
],
stats: getStatsConfig(options),
};
const extraPlugins = [];
if (options.progress) {
extraPlugins.push(new webpack_1.ProgressPlugin());
}
// process asset entries
if (options.assets) {
const copyWebpackPluginPatterns = options.assets.map(asset => {
return {
context: asset.input,
// Now we remove starting slash to make Webpack place it from the output root.
to: asset.output,
},
],
exclude: [/node_modules/],
}
],
},
resolve: {
modules: [SRC_DIR, 'node_modules'],
extensions: ['.ts', '.js'],
},
plugins: [
new ForkTsCheckerWebpackPlugin({
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
watch: SRC_DIR,
// CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
workers: isCI ? ForkTsCheckerWebpackPlugin.ONE_CPU : ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
memoryLimit: 4096,
}),
],
devtool: 'source-map',
node: {
child_process: 'empty',
net: 'empty',
fs: 'empty',
net: 'empty',
},
optimization: {
minimizer: [
new TerserPlugin({
sourceMap: true,
terserOptions: {
// Chevrotain does not cooperate with webpack mangling (see here: https://sap.github.io/chevrotain/docs/FAQ.html#MINIFIED).
],
exclude: [/node_modules/],
},
],
},
resolve: {
modules: [SRC_DIR, 'node_modules'],
extensions: ['.ts', '.js'],
},
plugins: [
new ForkTsCheckerWebpackPlugin({
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
watch: SRC_DIR,
// CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
workers: isCI
? ForkTsCheckerWebpackPlugin.ONE_CPU
: ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
memoryLimit: 4096,
}),
new CopyWebpackPlugin([
{
from: `${SRC_DIR}/index.d.ts`,
to: path.join(DIST_DIR, 'types', 'index.d.ts'),
},
]),
],
devtool: 'source-map',
};
const workerConfig = {
mode: 'production',
target: 'webworker',
],
exclude: [/node_modules/],
},
],
},
resolve: {
modules: [SRC_DIR, 'node_modules'],
extensions: ['.ts', '.js'],
},
plugins: [
new ForkTsCheckerWebpackPlugin({
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
watch: SRC_DIR,
// CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
workers: isCI
? ForkTsCheckerWebpackPlugin.ONE_CPU
: ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
memoryLimit: 4096,
}),
],
devtool: 'source-map',
node: {
child_process: 'empty',
net: 'empty',
fs: 'empty',
net: 'empty',
},
optimization: {
minimizer: [
new TerserPlugin({
sourceMap: true,
terserOptions: {
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url-loader?limit=10000&mimetype=image/svg+xml" },
{ test: /\.html$/, use: 'html-loader' }
];
const plugins = [
new webpack.IgnorePlugin({ resourceRegExp: /^\.\/locale$/, contextRegExp: /moment$/ }),
new webpack.ProvidePlugin({
"$":"jquery",
"jQuery":"jquery",
"window.jQuery":"jquery",
"d3": "d3"
}),
new ForkTsCheckerWebpackPlugin({
tsconfig: tsConfigPath,
watch: 'src',
workers: ForkTsCheckerWebpackPlugin.ONE_CPU
}),
new webpack.DefinePlugin({
BEAKERX_MODULE_VERSION: JSON.stringify("*") // The latest version
})
];
const externals = [
'@jupyter-widgets/base',
'@jupyter-widgets/controls'
];
const resolve = {
modules: ['web_modules', 'node_modules'],
extensions: ['.ts', '.jsx','.js','.less','.css'],
plugins: [new TsconfigPathsPlugin({ configFile: tsConfigPath })]
};
}
],
},
resolve: {
modules: [SRC_DIR, 'node_modules'],
extensions: ['.ts', '.js'],
},
plugins: [
new BannerPlugin({
banner: '#!/usr/bin/env node',
}),
new ForkTsCheckerWebpackPlugin({
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
watch: SRC_DIR,
// CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
workers: isCI ? ForkTsCheckerWebpackPlugin.ONE_CPU : ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
memoryLimit: 4096,
}),
],
devtool: 'source-map',
optimization: {
minimizer: [
new TerserPlugin({
sourceMap: true,
terserOptions: {
// Chevrotain does not cooperate with webpack mangling (see here: https://sap.github.io/chevrotain/docs/FAQ.html#MINIFIED).
mangle: {
reserved,
},
},
}),
],
}
],
},
resolve: {
modules: [SRC_DIR, 'node_modules'],
extensions: ['.ts', '.js'],
},
plugins: [
new BannerPlugin({
banner: '#!/usr/bin/env node',
}),
new ForkTsCheckerWebpackPlugin({
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
watch: SRC_DIR,
// CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
workers: isCI ? ForkTsCheckerWebpackPlugin.ONE_CPU : ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
memoryLimit: 4096,
}),
],
devtool: 'source-map',
optimization: {
minimizer: [
new TerserPlugin({
sourceMap: true,
terserOptions: {
// Chevrotain does not cooperate with webpack mangling (see here: https://sap.github.io/chevrotain/docs/FAQ.html#MINIFIED).
mangle: {
reserved,
},
},
}),
],
}
// Add .ts extension in webpack resolve
if (config.resolve.extensions.indexOf('.ts') === -1) {
config.resolve.extensions.push('.ts');
}
if (config.resolve.extensions.indexOf('.tsx') === -1) {
config.resolve.extensions.push('.tsx');
}
// Add a fork ts checker webpack plugin
if (config.name === 'client') {
const tsCheckerDefaultOptions = {
checkSyntacticErrors: !!options.thread,
workers: ForkTsCheckerWebpackPlugin.ONE_CPU,
formatter: 'codeframe',
vue: true,
tsconfig: options.tsconfig || tsconfigDefault,
};
config.plugins.push(
new ForkTsCheckerWebpackPlugin(tsCheckerDefaultOptions),
);
}
});
}
},
],
exclude: [/node_modules/],
}
],
},
resolve: {
modules: [SRC_DIR, 'node_modules'],
extensions: ['.ts', '.js'],
},
plugins: [
new ForkTsCheckerWebpackPlugin({
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
watch: SRC_DIR,
// CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
workers: isCI ? ForkTsCheckerWebpackPlugin.ONE_CPU : ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
memoryLimit: 4096,
}),
],
devtool: 'source-map',
node: {
child_process: 'empty',
net: 'empty',
fs: 'empty',
net: 'empty',
},
optimization: {
minimizer: [
new TerserPlugin({
sourceMap: true,
terserOptions: {
// Chevrotain does not cooperate with webpack mangling (see here: https://sap.github.io/chevrotain/docs/FAQ.html#MINIFIED).
],
exclude: [/node_modules/],
},
],
},
resolve: {
modules: [SRC_DIR, 'node_modules'],
extensions: ['.ts', '.js'],
},
plugins: [
new ForkTsCheckerWebpackPlugin({
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
watch: SRC_DIR,
// CI memory limits make building with more than one CPU for type-checking too fragile, unfortunately
workers: isCI
? ForkTsCheckerWebpackPlugin.ONE_CPU
: ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE,
memoryLimit: 4096,
}),
],
devtool: 'source-map',
node: {
child_process: 'empty',
net: 'empty',
fs: 'empty',
net: 'empty',
},
optimization: {
minimizer: [
new TerserPlugin({
sourceMap: true,
terserOptions: {