mirror of
https://github.com/flarum/framework.git
synced 2025-01-28 03:15:34 +08:00
Support, update to webpack 5 (#3135)
This commit is contained in:
parent
ca575acfbd
commit
f6e5c15af9
6799
framework/core/js/package-lock.json
generated
6799
framework/core/js/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -9,7 +9,7 @@
|
||||||
"clsx": "^1.1.1",
|
"clsx": "^1.1.1",
|
||||||
"color-thief-browser": "^2.0.2",
|
"color-thief-browser": "^2.0.2",
|
||||||
"dayjs": "^1.10.7",
|
"dayjs": "^1.10.7",
|
||||||
"expose-loader": "^1.0.3",
|
"expose-loader": "^2.0.0",
|
||||||
"jquery": "^3.6.0",
|
"jquery": "^3.6.0",
|
||||||
"jquery.hotkeys": "^0.1.0",
|
"jquery.hotkeys": "^0.1.0",
|
||||||
"mithril": "^2.0.4",
|
"mithril": "^2.0.4",
|
||||||
|
@ -28,10 +28,10 @@
|
||||||
"bundlewatch": "^0.3.2",
|
"bundlewatch": "^0.3.2",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"flarum-tsconfig": "^1.0.2",
|
"flarum-tsconfig": "^1.0.2",
|
||||||
"flarum-webpack-config": "1.0.0",
|
"flarum-webpack-config": "2.0.0",
|
||||||
"prettier": "^2.4.1",
|
"prettier": "^2.4.1",
|
||||||
"typescript": "^4.4.4",
|
"typescript": "^4.4.4",
|
||||||
"webpack": "^4.46.0",
|
"webpack": "^5.60.0",
|
||||||
"webpack-cli": "^4.9.1",
|
"webpack-cli": "^4.9.1",
|
||||||
"webpack-merge": "^4.2.2"
|
"webpack-merge": "^4.2.2"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Expose jQuery, mithril and dayjs to the window browser object
|
// Expose jQuery, mithril and dayjs to the window browser object
|
||||||
import 'expose-loader?exposes[]=$&exposes[]=jQuery!jquery';
|
import 'expose-loader?exposes=$,jQuery!jquery';
|
||||||
import 'expose-loader?exposes=m!mithril';
|
import 'expose-loader?exposes=m!mithril';
|
||||||
import 'expose-loader?exposes=dayjs!dayjs';
|
import 'expose-loader?exposes=dayjs!dayjs';
|
||||||
|
|
||||||
|
|
|
@ -179,11 +179,11 @@ class Frontend implements ExtenderInterface
|
||||||
if ($this->js) {
|
if ($this->js) {
|
||||||
$assets->js(function (SourceCollector $sources) use ($moduleName) {
|
$assets->js(function (SourceCollector $sources) use ($moduleName) {
|
||||||
$sources->addString(function () {
|
$sources->addString(function () {
|
||||||
return 'var module={}';
|
return 'var module={};';
|
||||||
});
|
});
|
||||||
$sources->addFile($this->js);
|
$sources->addFile($this->js);
|
||||||
$sources->addString(function () use ($moduleName) {
|
$sources->addString(function () use ($moduleName) {
|
||||||
return "flarum.extensions['$moduleName']=module.exports";
|
return "flarum.extensions['$moduleName']=module.exports;";
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user