Skip to content

Commit

Permalink
Make jquery-ui a peerdependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ComLock committed Oct 9, 2023
1 parent 93fe949 commit 0c220fe
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 11 deletions.
23 changes: 22 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
"dompurify": "^3.0.6",
"fine-uploader": "^5.16.2",
"jquery-simulate": "^1.0.2",
"jquery-ui": "^1.13.2",
"mousetrap": "^1.6.5",
"q": "^1.5.1",
"slickgrid": "^4.0.1",
"validator": "^13.11.0"
},
"peerDependencies": {
"jquery": "^3.7.1",
"jquery-ui-dist": "^1.13.2",
"postcss": "^8.2.2"
},
"devDependencies": {
Expand All @@ -58,6 +58,7 @@
"error-logger-webpack-plugin": "^1.1.1",
"eslint": "^8.50.0",
"glob": "^10.3.10",
"jquery-ui": "^1.13.2",
"less": "^4.2.0",
"less-loader": "^11.1.3",
"mini-css-extract-plugin": "^2.7.6",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/admin/common/js/dom/Element.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Q from 'q';
import 'jquery-ui/ui/tabbable';
// import 'jquery-ui/ui/tabbable'; // jquery-ui is a peerDependency
import {StyleHelper} from '../StyleHelper';
import {StringHelper} from '../util/StringHelper';
import {ObjectHelper} from '../ObjectHelper';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'jquery-ui/ui/widgets/sortable'; // jquery-ui is a peerDependency
// import 'jquery-ui/ui/widgets/sortable'; // jquery-ui is a peerDependency
import * as Q from 'q';
import {Property} from '../../../data/Property';
import {PropertyArray} from '../../../data/PropertyArray';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'jquery-ui/ui/widgets/sortable';
// import 'jquery-ui/ui/widgets/sortable'; // jquery-ui is a peerDependency
import {DivEl} from '../../../dom/DivEl';
import {Element} from '../../../dom/Element';
import {Option} from '../Option';
Expand Down
15 changes: 9 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const ProvidePlugin = require('webpack/lib/ProvidePlugin');
// const ProvidePlugin = require('webpack/lib/ProvidePlugin');
const path = require('path');
const fs = require('fs');

Expand All @@ -18,6 +18,9 @@ module.exports = {
'styles/lib': './styles/main.less',
'styles/lib.lite': './styles/main.lite.less',
},
externals: {
jquery: 'jQuery',
},
output: {
path: path.join(__dirname, '/build/resources/main/assets/admin/common'),
filename: './[name].js',
Expand Down Expand Up @@ -70,11 +73,11 @@ module.exports = {
]
},
plugins: [
new ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
}),
// new ProvidePlugin({
// $: 'jquery',
// jQuery: 'jquery',
// 'window.jQuery': 'jquery'
// }),
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: './styles/[id].css'
Expand Down

0 comments on commit 0c220fe

Please sign in to comment.