wp-blank-scripts 4.0.0-dev-0 → 4.0.0-dev-2
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/package.json +1 -1
- package/webpack.base.config.js +6 -4
- package/webpack.wp.config.js +3 -3
package/package.json
CHANGED
package/webpack.base.config.js
CHANGED
|
@@ -168,11 +168,13 @@ function makeBaseConfig(options) {
|
|
|
168
168
|
];
|
|
169
169
|
|
|
170
170
|
// Admin entries
|
|
171
|
-
const adminScripts = glob.sync(path.join(sourcePath, '
|
|
171
|
+
const adminScripts = glob.sync(path.join(sourcePath, 'admin', '*.js'));
|
|
172
172
|
|
|
173
|
-
const adminStyles = glob.sync(path.join(sourcePath, '
|
|
173
|
+
const adminStyles = glob.sync(path.join(sourcePath, 'admin', '*.scss'));
|
|
174
174
|
const mainStyleVariables = path.join(sourcePath, 'assets', 'css', 'utils', 'variables.scss'); //* Not sure if this is needed.
|
|
175
175
|
|
|
176
|
+
console.log(adminStyles);
|
|
177
|
+
|
|
176
178
|
const blockJsonFiles = [];
|
|
177
179
|
|
|
178
180
|
glob.sync(path.join(sourcePath, 'blocks', '***', '*.json')).forEach((filePath) => {
|
|
@@ -184,11 +186,11 @@ function makeBaseConfig(options) {
|
|
|
184
186
|
|
|
185
187
|
blockJsonFiles.forEach((file) => {
|
|
186
188
|
const content = JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
187
|
-
if (content.editorScript
|
|
189
|
+
if (content.editorScript) {
|
|
188
190
|
const editorScript = `${path.dirname(file)}/${content.editorScript}`;
|
|
189
191
|
blockJsonScripts.push(editorScript);
|
|
190
192
|
}
|
|
191
|
-
if (content.editorStyle
|
|
193
|
+
if (content.editorStyle) {
|
|
192
194
|
const editorStyle = `${path.dirname(file)}/${content.editorStyle}`;
|
|
193
195
|
blockJsonStyles.push(editorStyle);
|
|
194
196
|
}
|
package/webpack.wp.config.js
CHANGED
|
@@ -27,11 +27,11 @@ function makeWpWebpackConfig() {
|
|
|
27
27
|
|
|
28
28
|
blockJsonFiles.forEach((file) => {
|
|
29
29
|
const content = JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
30
|
-
if (content.viewScript
|
|
30
|
+
if (content.viewScript) {
|
|
31
31
|
const viewScript = `${path.dirname(file)}/${content.viewScript}`;
|
|
32
32
|
blockJsonScripts.push(viewScript);
|
|
33
33
|
}
|
|
34
|
-
if (content.style
|
|
34
|
+
if (content.style) {
|
|
35
35
|
const style = `${path.dirname(file)}/${content.style}`;
|
|
36
36
|
blockJsonStyles.push(style);
|
|
37
37
|
}
|
|
@@ -49,7 +49,7 @@ function makeWpWebpackConfig() {
|
|
|
49
49
|
return {
|
|
50
50
|
entry: {
|
|
51
51
|
main: [...blockJsonScripts, ...entryScript],
|
|
52
|
-
style: [...
|
|
52
|
+
style: [...blockJsonScripts, ...mainStyles],
|
|
53
53
|
},
|
|
54
54
|
plugins: [
|
|
55
55
|
new MiniCssExtractPlugin({
|