wp-blank-scripts 4.0.0-dev-7 → 4.0.0-dev-9
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/README.md +1 -1
- package/package.json +1 -1
- package/webpack.base.config.js +9 -9
- package/webpack.react.config.js +1 -1
- package/webpack.wp.config.js +15 -2
package/README.md
CHANGED
package/package.json
CHANGED
package/webpack.base.config.js
CHANGED
|
@@ -47,18 +47,18 @@ function makeBaseConfig(options) {
|
|
|
47
47
|
},
|
|
48
48
|
{ from: path.join(sourceDir, 'style.css'), to: themePath },
|
|
49
49
|
{
|
|
50
|
-
from: path.join(sourceDir, 'assets', '
|
|
51
|
-
to: path.join(themePath, 'assets', '
|
|
50
|
+
from: path.join(sourceDir, 'assets', 'images'),
|
|
51
|
+
to: path.join(themePath, 'assets', 'images'),
|
|
52
52
|
globOptions: { ignore: ['.DS_Store'] },
|
|
53
53
|
},
|
|
54
54
|
...(fs.existsSync(fontsDir)
|
|
55
55
|
? [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
{
|
|
57
|
+
from: fontsDir,
|
|
58
|
+
to: path.join(themePath, 'assets', 'fonts'),
|
|
59
|
+
globOptions: { ignore: ['.DS_Store'] },
|
|
60
|
+
},
|
|
61
|
+
]
|
|
62
62
|
: []),
|
|
63
63
|
{
|
|
64
64
|
from: path.join(sourceDir, 'templates'),
|
|
@@ -69,7 +69,7 @@ function makeBaseConfig(options) {
|
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
from: path.join(sourceDir, 'parts'),
|
|
72
|
-
to: themePath,
|
|
72
|
+
to: path.join(themePath, 'parts'),
|
|
73
73
|
globOptions: {
|
|
74
74
|
ignore: ['.DS_Store'],
|
|
75
75
|
},
|
package/webpack.react.config.js
CHANGED
|
@@ -147,7 +147,7 @@ function makeReactWebpackConfig(options) {
|
|
|
147
147
|
test: /\.(gif|png|svg|jpe?g)$/i,
|
|
148
148
|
type: 'asset/resource',
|
|
149
149
|
generator: {
|
|
150
|
-
filename: `${path.join(themeDir, 'assets', '
|
|
150
|
+
filename: `${path.join(themeDir, 'assets', 'images')}/[contenthash][ext][query]`,
|
|
151
151
|
},
|
|
152
152
|
},
|
|
153
153
|
{
|
package/webpack.wp.config.js
CHANGED
|
@@ -37,6 +37,19 @@ function makeWpWebpackConfig() {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
+
const partsStyles = [];
|
|
41
|
+
const partsScripts = [];
|
|
42
|
+
|
|
43
|
+
// Front end component scripts
|
|
44
|
+
glob.sync(path.join(sourcePath, 'parts', '***', '*.js')).forEach((filePath) => {
|
|
45
|
+
partsScripts.push(filePath);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Front end component styles
|
|
49
|
+
glob.sync(path.join(sourcePath, 'parts', '***', '*.{scss,css}')).forEach((filePath) => {
|
|
50
|
+
partsStyles.push(filePath);
|
|
51
|
+
});
|
|
52
|
+
|
|
40
53
|
const entryScript = glob.sync(path.join(sourcePath, 'index.js'));
|
|
41
54
|
|
|
42
55
|
if (!entryScript) {
|
|
@@ -48,8 +61,8 @@ function makeWpWebpackConfig() {
|
|
|
48
61
|
|
|
49
62
|
return {
|
|
50
63
|
entry: {
|
|
51
|
-
main: [...blockJsonScripts, ...entryScript],
|
|
52
|
-
style: [...blockJsonStyles, ...mainStyles],
|
|
64
|
+
main: [...blockJsonScripts, ...partsScripts, ...entryScript],
|
|
65
|
+
style: [...blockJsonStyles, ...partsStyles, ...mainStyles],
|
|
53
66
|
},
|
|
54
67
|
plugins: [
|
|
55
68
|
new MiniCssExtractPlugin({
|