-
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
c047ca1
commit b415a6c
Showing
11 changed files
with
145 additions
and
19 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
7 changes: 0 additions & 7 deletions
7
liferay-sample-etc-frontend-shared-import-map/assets/custom-element/package.json
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
liferay-sample-etc-frontend-shared-import-map/assets/my-utils/package.json
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
liferay-sample-etc-frontend-shared-import-map/client-extension.dev.yaml
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 @@ | ||
liferay-sample-etc-frontend-3-custom-element: | ||
baseURL: http://localhost:3000 | ||
urls: | ||
- custom-element.js | ||
liferay-sample-etc-frontend-3-js-import-maps-entry: | ||
baseURL: http://localhost:3000 | ||
url: my-utils.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
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 |
---|---|---|
@@ -1,8 +1,12 @@ | ||
{ | ||
"name": "@liferay/liferay-sample-js-importmaps-entry-1", | ||
"devDependencies": { | ||
"webpack": "5.90.1", | ||
"webpack-cli": "5.1.4" | ||
}, | ||
"name": "@liferay/liferay-sample-etc-frontend-3", | ||
"private": true, | ||
"workspaces": [ | ||
"assets/custom-element", | ||
"assets/my-utils" | ||
] | ||
"scripts": { | ||
"build": "webpack", | ||
"start": "webpack-dev-server" | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
liferay-sample-etc-frontend-shared-import-map/webpack.config.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,51 @@ | ||
/** | ||
* 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'; | ||
const WEBPACK_SERVE = !!process.env.WEBPACK_SERVE; | ||
|
||
module.exports = { | ||
devServer: { | ||
headers: { | ||
'Access-Control-Allow-Origin': '*', | ||
}, | ||
port: 3000, | ||
}, | ||
devtool: DEVELOPMENT ? 'source-map' : false, | ||
entry: { | ||
'custom-element': './assets/custom-element/index.js', | ||
'my-utils': './assets/my-utils/index.js', | ||
}, | ||
experiments: { | ||
outputModule: true, | ||
}, | ||
externals: { | ||
'my-utils': 'my-utils', | ||
}, | ||
mode: DEVELOPMENT ? 'development' : 'production', | ||
optimization: { | ||
minimize: !DEVELOPMENT, | ||
}, | ||
output: { | ||
clean: true, | ||
environment: { | ||
dynamicImport: true, | ||
module: true, | ||
}, | ||
filename: WEBPACK_SERVE ? '[name].js' : '[name].[contenthash].js', | ||
library: { | ||
type: 'module', | ||
}, | ||
path: path.resolve('build', 'static'), | ||
}, | ||
plugins: [ | ||
new webpack.optimize.LimitChunkCountPlugin({ | ||
maxChunks: 1, | ||
}), | ||
], | ||
}; |
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,8 @@ | ||
/** | ||
* 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 | ||
*/ | ||
|
||
import jquery from 'jquery'; | ||
|
||
export default jquery; |
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,8 @@ | ||
assemble: | ||
- from: build/static | ||
into: static | ||
liferay-sample-js-import-maps-entry: | ||
bareSpecifier: jquery | ||
name: Liferay Sample JS Import Maps Entry | ||
type: jsImportMapsEntry | ||
url: jquery.*.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,15 @@ | ||
{ | ||
"dependencies": { | ||
"jquery": "3.7.1" | ||
}, | ||
"devDependencies": { | ||
"webpack": "5.90.1", | ||
"webpack-cli": "5.1.4" | ||
}, | ||
"name": "@liferay/liferay-sample-js-importmaps-entry", | ||
"private": true, | ||
"scripts": { | ||
"build": "webpack" | ||
}, | ||
"version": "0.1.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,40 @@ | ||
/** | ||
* 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: { | ||
jquery: './assets/index.js', | ||
}, | ||
experiments: { | ||
outputModule: true, | ||
}, | ||
mode: DEVELOPMENT ? 'development' : 'production', | ||
optimization: { | ||
minimize: !DEVELOPMENT, | ||
}, | ||
output: { | ||
clean: true, | ||
environment: { | ||
dynamicImport: true, | ||
module: true, | ||
}, | ||
filename: '[name].[contenthash].js', | ||
library: { | ||
type: 'module', | ||
}, | ||
path: path.resolve('build', 'static'), | ||
}, | ||
plugins: [ | ||
new webpack.optimize.LimitChunkCountPlugin({ | ||
maxChunks: 1, | ||
}), | ||
], | ||
}; |