@patternslib/dev 3.6.0 → 3.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +12 -0
- package/package.json +1 -1
- package/webpack/style-inserter.js +12 -0
- package/webpack/webpack-helpers.js +4 -13
- package/webpack/webpack.config.js +1 -2
package/CHANGES.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [3.6.1](https://github.com/patternslib/dev/compare/3.6.0...3.6.1) (2024-08-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
* Webpack style loader. ([ecec3cf](https://github.com/patternslib/dev/commit/ecec3cf5654050c8ec96a924fcaa8bad618d526c))
|
|
12
|
+
|
|
13
|
+
Webpack style loader's insert option needs a different way to reference functions.
|
|
14
|
+
Also deprecate webpack-helpers module.
|
|
15
|
+
|
|
5
16
|
## [3.6.0](https://github.com/patternslib/dev/compare/3.5.3...3.6.0) (2024-08-14)
|
|
6
17
|
|
|
7
18
|
|
|
@@ -49,6 +60,7 @@ Note: As time of this commit, versions below 18 are unmaintained.
|
|
|
49
60
|
|
|
50
61
|
* Upgrade GitHub Actions. ([f687bee](https://github.com/patternslib/dev/commit/f687bee3dcd94b50b14fd5df3370aa9ecf245943))
|
|
51
62
|
|
|
63
|
+
|
|
52
64
|
## [3.5.3](https://github.com/patternslib/dev/compare/3.5.2...3.5.3) (2023-11-22)
|
|
53
65
|
|
|
54
66
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function style_inserter(el) {
|
|
2
|
+
// Insert element at the top of <head>
|
|
3
|
+
// Used for injecting CSS via webpack before any other CSS
|
|
4
|
+
var first_child = document.head.querySelectorAll("*")[0];
|
|
5
|
+
if (first_child) {
|
|
6
|
+
document.head.insertBefore(el, first_child);
|
|
7
|
+
} else {
|
|
8
|
+
document.head.append(el);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
module.exports = style_inserter;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// Note:
|
|
5
|
-
// Keep code compatible with IE11 as long as we support it.
|
|
6
|
-
var first_child = document.head.querySelectorAll("*")[0];
|
|
7
|
-
if (first_child) {
|
|
8
|
-
document.head.insertBefore(el, first_child);
|
|
9
|
-
} else {
|
|
10
|
-
document.head.append(el);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
1
|
+
// BBB
|
|
2
|
+
// TODO: Remove in next major version.
|
|
3
|
+
const style_inserter = require("./style-inserter");
|
|
13
4
|
|
|
14
5
|
module.exports = {
|
|
15
|
-
top_head_insert:
|
|
6
|
+
top_head_insert: style_inserter,
|
|
16
7
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
process.traceDeprecation = true;
|
|
2
2
|
const webpack = require("webpack");
|
|
3
|
-
const webpack_helpers = require("./webpack-helpers");
|
|
4
3
|
|
|
5
4
|
// plugins
|
|
6
5
|
const TerserPlugin = require("terser-webpack-plugin");
|
|
@@ -60,7 +59,7 @@ const config_factory = (env, argv, config, babel_include = [], package_json) =>
|
|
|
60
59
|
{
|
|
61
60
|
loader: "style-loader",
|
|
62
61
|
options: {
|
|
63
|
-
insert:
|
|
62
|
+
insert: require.resolve("./style-inserter"),
|
|
64
63
|
},
|
|
65
64
|
},
|
|
66
65
|
"css-loader",
|