8
0
Просмотр исходного кода

Simplified the webpack configuration.

Kamil Piechaczek 5 лет назад
Родитель
Сommit
498553ffe7
1 измененных файлов с 3 добавлено и 34 удалено
  1. 3 34
      scripts/docs/snippetadapter.js

+ 3 - 34
scripts/docs/snippetadapter.js

@@ -390,19 +390,13 @@ function getWebpackConfig( snippets, config ) {
 			} )
 		],
 
-		// Configure the paths so building CKEditor 5 snippets work even if the script
-		// is triggered from a directory outside ckeditor5 (e.g. multi-project case).
-		resolve: {
+		resolveLoader: {
 			modules: [
-				...getPackageDependenciesPaths(),
-				...getModuleResolvePaths()
+				path.resolve( __dirname, '..', '..', 'node_modules' ),
+				'node_modules'
 			]
 		},
 
-		resolveLoader: {
-			modules: getModuleResolvePaths()
-		},
-
 		module: {
 			rules: [
 				{
@@ -464,31 +458,6 @@ function runWebpack( webpackConfig ) {
 	} );
 }
 
-/**
- * @returns {Array.<String>}
- */
-function getModuleResolvePaths() {
-	return [
-		path.resolve( __dirname, '..', '..', 'node_modules' ),
-		'node_modules'
-	];
-}
-
-/**
- * Returns an array that contains paths to packages' dependencies.
- * The snippet adapter should use packages' dependencies instead of the documentation builder dependencies.
- *
- * See #7916.
- *
- * @returns {Array.<String>}
- */
-function getPackageDependenciesPaths() {
-	const packagesDirectory = path.resolve( __dirname, '..', '..', 'packages' );
-
-	return fs.readdirSync( packagesDirectory )
-		.map( directory => path.join( packagesDirectory, directory, 'node_modules' ) );
-}
-
 /**
  * Reads the snippet's configuration.
  *