|
|
@@ -31,6 +31,7 @@ module.exports = function snippetAdapter( data ) {
|
|
|
|
|
|
function getWebpackConfig( config ) {
|
|
|
return {
|
|
|
+
|
|
|
devtool: 'source-map',
|
|
|
|
|
|
entry: config.entry,
|
|
|
@@ -50,6 +51,16 @@ function getWebpackConfig( 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: {
|
|
|
+ modules: getModuleResolvePaths()
|
|
|
+ },
|
|
|
+
|
|
|
+ resolveLoader: {
|
|
|
+ modules: getModuleResolvePaths()
|
|
|
+ },
|
|
|
+
|
|
|
module: {
|
|
|
rules: [
|
|
|
{
|
|
|
@@ -95,3 +106,10 @@ function generateSnippetHtml( data ) {
|
|
|
|
|
|
return html;
|
|
|
}
|
|
|
+
|
|
|
+function getModuleResolvePaths() {
|
|
|
+ return [
|
|
|
+ path.resolve( __dirname, '..', '..', '..', 'node_modules' ),
|
|
|
+ 'node_modules'
|
|
|
+ ];
|
|
|
+}
|