Skip to content

Commit

Permalink
Added dependencies clientlibs to match archetype (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgonzalez authored Jun 13, 2024
1 parent 01f45d9 commit 16890ce
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 68 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#base=css

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#base=js

147 changes: 79 additions & 68 deletions ui.frontend/clientlib.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,72 +14,83 @@
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

const path = require('path');
const path = require('path');

const BUILD_DIR = path.join(__dirname, 'dist');
const CLIENTLIB_DIR = path.join(
__dirname,
'..',
'ui.apps',
'src',
'main',
'content',
'jcr_root',
'apps',
'wknd',
'clientlibs'
);

const libsBaseConfig = {
allowProxy: true,
serializationFormat: 'xml',
cssProcessor: ['default:none', 'min:none'],
jsProcessor: ['default:none', 'min:none']
};

// Config for `aem-clientlib-generator`
module.exports = {
context: BUILD_DIR,
clientLibRoot: CLIENTLIB_DIR,
libs: [
/* These embeds and categories can added to clientlib-site below as well */
{
...libsBaseConfig,
name: 'clientlib-dependencies',
categories: ['wknd.dependencies'],
// Add AEM OOTB client libraries as needed
embed: ['granite.csrf.standalone'],
assets: {
// Add any CSS and JS entrypoint scripts and stylesheets into the dependencies clientlib
}
},
{
...libsBaseConfig,
name: 'clientlib-site',
categories: ['wknd.site'],
dependencies: ['wknd.dependencies'],
assets: {
// Copy entrypoint scripts and stylesheets into the respective ClientLib
// directories
js: {
cwd: 'clientlib-site',
files: ['**/*.js'],
flatten: false
},
css: {
cwd: 'clientlib-site',
files: ['**/*.css'],
flatten: false
},

// Copy all other files into the `resources` ClientLib directory
resources: {
cwd: 'clientlib-site',
files: ['**/*.*'],
flatten: false,
ignore: ['**/*.js', '**/*.css']
}
}
}
]
};
const BUILD_DIR = path.join(__dirname, 'dist');
const CLIENTLIB_DIR = path.join(
__dirname,
'..',
'ui.apps',
'src',
'main',
'content',
'jcr_root',
'apps',
'wknd',
'clientlibs'
);

const libsBaseConfig = {
allowProxy: true,
serializationFormat: 'xml',
cssProcessor: ['default:none', 'min:none'],
jsProcessor: ['default:none', 'min:none']
};

// Config for `aem-clientlib-generator`
module.exports = {
context: BUILD_DIR,
clientLibRoot: CLIENTLIB_DIR,
libs: [
/* These embeds and categories can added to clientlib-site below as well */
{
...libsBaseConfig,
name: 'clientlib-dependencies',
categories: ['wknd.dependencies'],
// Add AEM OOTB client libraries as needed
embed: ['granite.csrf.standalone'],
assets: {
// Any any CSS and JS entrypoint scripts and stylesheets into the dependencies
js: {
cwd: 'clientlib-dependencies',
files: ['**/*.js'],
flatten: false
},
css: {
cwd: 'clientlib-dependencies',
files: ['**/*.css'],
flatten: false
}
}
},
{
...libsBaseConfig,
name: 'clientlib-site',
categories: ['wknd.site'],
dependencies: ['wknd.dependencies'],
assets: {
// Copy entrypoint scripts and stylesheets into the respective ClientLib
// directories
js: {
cwd: 'clientlib-site',
files: ['**/*.js'],
flatten: false
},
css: {
cwd: 'clientlib-site',
files: ['**/*.css'],
flatten: false
},

// Copy all other files into the `resources` ClientLib directory
resources: {
cwd: 'clientlib-site',
files: ['**/*.*'],
flatten: false,
ignore: ['**/*.js', '**/*.css']
}
}
}
]
};

0 comments on commit 16890ce

Please sign in to comment.