Skip to content

Commit

Permalink
chore: auto update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 19, 2024
1 parent 30c23a0 commit 53a65fe
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 0 deletions.
4 changes: 4 additions & 0 deletions HOW-TO.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ For `liferay-sample-etc-cron` and `liferay-sample-etc-spring-boot` the third typ

Add a global script element with attributes to a page.

- *liferay-sample-global-js-3*

Add a global script element to an instance.

- *liferay-sample-iframe-1*

Add an IFrame widget with an interactive counter app.
Expand Down
7 changes: 7 additions & 0 deletions liferay-sample-global-js-3/assets/global.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/

// eslint-disable-next-line no-console
console.log('Sample Global JS 3 deployed.');
9 changes: 9 additions & 0 deletions liferay-sample-global-js-3/client-extension.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
assemble:
- from: build/static
into: static
liferay-sample-global-js-3:
name: Liferay Sample Global JS 3
scope: "instance"
scriptLocation: "head"
type: globalJS
url: global.*.js
12 changes: 12 additions & 0 deletions liferay-sample-global-js-3/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"devDependencies": {
"webpack": "5.90.1",
"webpack-cli": "5.1.4"
},
"name": "@liferay/liferay-sample-global-js-3",
"private": true,
"scripts": {
"build": "webpack"
},
"version": "0.0.0"
}
29 changes: 29 additions & 0 deletions liferay-sample-global-js-3/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/

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

const DEVELOPMENT = process.env.NODE_ENV === 'development';

module.exports = {
devtool: DEVELOPMENT ? 'source-map' : false,
entry: {
global: './assets/global.js',
},
mode: DEVELOPMENT ? 'development' : 'production',
optimization: {
minimize: !DEVELOPMENT,
},
output: {
filename: '[name].[contenthash].js',
path: path.resolve('build', 'static'),
},
plugins: [
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
}),
],
};

0 comments on commit 53a65fe

Please sign in to comment.