-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30c23a0
commit 53a65fe
Showing
5 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}), | ||
], | ||
}; |