-
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
7855d30
commit e6dafcd
Showing
10 changed files
with
106 additions
and
7 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
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
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,7 +1,6 @@ | ||
assemble: | ||
- from: assets | ||
into: static | ||
- include: static/*.css | ||
liferay-sample-global-css: | ||
name: Liferay Sample Global CSS | ||
type: globalCSS | ||
url: global.css | ||
url: global.*.css |
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 @@ | ||
{ | ||
"devDependencies": { | ||
"css-loader": "6.10.0", | ||
"mini-css-extract-plugin": "^2.8.0", | ||
"style-loader": "3.3.4", | ||
"webpack": "5.90.1", | ||
"webpack-cli": "5.1.4" | ||
}, | ||
"name": "@liferay/liferay-sample-global-css", | ||
"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,41 @@ | ||
/** | ||
* 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 MiniCssExtractPlugin = require('mini-css-extract-plugin'); | ||
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.css', | ||
}, | ||
mode: DEVELOPMENT ? 'development' : 'production', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/i, | ||
use: [MiniCssExtractPlugin.loader, 'css-loader'], | ||
}, | ||
], | ||
}, | ||
optimization: { | ||
minimize: !DEVELOPMENT, | ||
}, | ||
output: { | ||
clean: true, | ||
path: path.resolve('static'), | ||
}, | ||
plugins: [ | ||
new MiniCssExtractPlugin({ | ||
filename: '[name].[contenthash].css', | ||
}), | ||
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
assemble: | ||
- from: assets | ||
- from: build/static | ||
into: static | ||
liferay-sample-global-js: | ||
name: Liferay Sample Global JS | ||
type: globalJS | ||
url: global.js | ||
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", | ||
"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,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, | ||
}), | ||
], | ||
}; |