Skip to content

Commit

Permalink
Merge pull request #91 from 10up/fix/empty-js-file-output-from-css-entry
Browse files Browse the repository at this point in the history
Fix empty js file output from css entry
  • Loading branch information
nicholasio authored Jul 25, 2021
2 parents 1db3802 + 74b5d01 commit 789ddee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Object {
StylelintWebpackPlugin: {"extensions":["css","scss","sass"],"emitError":true,"emitWarning":true,"failOnError":true,"context":"/assets","files":"**/*.(s(c|a)ss|css)","allowEmptyInput":true,"configFile":"/config/stylelint.config.js"},
WebpackBarPlugin: {"name":"webpack","color":"green","reporters":["basic"],"reporter":null},
CleanExtractedDeps: {},
WebpackRemoveEmptyScriptsPlugin: {"verbose":false,"extensions":["css","scss","sass","less","styl"],"scriptExtensions":["js","mjs"],"ignore":[]},
],
"resolve": Object {
"alias": Object {
Expand Down Expand Up @@ -344,6 +345,7 @@ Object {
StylelintWebpackPlugin: {"extensions":["css","scss","sass"],"emitError":true,"emitWarning":true,"failOnError":true,"context":"/assets","files":"**/*.(s(c|a)ss|css)","allowEmptyInput":true},
WebpackBarPlugin: {"name":"webpack","color":"green","reporters":["basic"],"reporter":null},
CleanExtractedDeps: {},
WebpackRemoveEmptyScriptsPlugin: {"verbose":false,"extensions":["css","scss","sass","less","styl"],"scriptExtensions":["js","mjs"],"ignore":[]},
],
"resolve": Object {
"alias": Object {
Expand Down Expand Up @@ -509,6 +511,7 @@ Object {
WebpackBarPlugin: {"name":"webpack","color":"green","reporters":["basic"],"reporter":null},
DependencyExtractionWebpackPlugin: {"combineAssets":false,"combinedOutputFile":null,"injectPolyfill":true,"outputFormat":"php","useDefaults":true},
CleanExtractedDeps: {},
WebpackRemoveEmptyScriptsPlugin: {"verbose":false,"extensions":["css","scss","sass","less","styl"],"scriptExtensions":["js","mjs"],"ignore":[]},
],
"resolve": Object {
"alias": Object {
Expand Down Expand Up @@ -706,6 +709,7 @@ Object {
StylelintWebpackPlugin: {"extensions":["css","scss","sass"],"emitError":true,"emitWarning":true,"failOnError":true,"context":"/assets","files":"**/*.(s(c|a)ss|css)","allowEmptyInput":true,"configFile":"/config/stylelint.config.js"},
WebpackBarPlugin: {"name":"webpack","color":"green","reporters":["basic"],"reporter":null},
CleanExtractedDeps: {},
WebpackRemoveEmptyScriptsPlugin: {"verbose":false,"extensions":["css","scss","sass","less","styl"],"scriptExtensions":["js","mjs"],"ignore":[]},
],
"resolve": Object {
"alias": Object {
Expand Down Expand Up @@ -895,6 +899,7 @@ Object {
StylelintWebpackPlugin: {"extensions":["css","scss","sass"],"emitError":true,"emitWarning":true,"failOnError":true,"context":"/assets","files":"**/*.(s(c|a)ss|css)","allowEmptyInput":true,"configFile":"/config/stylelint.config.js"},
WebpackBarPlugin: {"name":"webpack","color":"green","reporters":["basic"],"reporter":null},
CleanExtractedDeps: {},
WebpackRemoveEmptyScriptsPlugin: {"verbose":false,"extensions":["css","scss","sass","less","styl"],"scriptExtensions":["js","mjs"],"ignore":[]},
],
"resolve": Object {
"alias": Object {
Expand Down Expand Up @@ -1093,6 +1098,7 @@ Object {
StylelintWebpackPlugin: {"extensions":["css","scss","sass"],"emitError":true,"emitWarning":true,"failOnError":true,"context":"/assets","files":"**/*.(s(c|a)ss|css)","allowEmptyInput":true,"configFile":"/config/stylelint.config.js"},
WebpackBarPlugin: {"name":"webpack","color":"green","reporters":["basic"],"reporter":null},
CleanExtractedDeps: {},
WebpackRemoveEmptyScriptsPlugin: {"verbose":false,"extensions":["css","scss","sass","less","styl"],"scriptExtensions":["js","mjs"],"ignore":[]},
],
"resolve": Object {
"alias": Object {
Expand Down Expand Up @@ -1281,6 +1287,7 @@ Object {
WebpackBarPlugin: {"name":"webpack","color":"green","reporters":["basic"],"reporter":null},
DependencyExtractionWebpackPlugin: {"combineAssets":false,"combinedOutputFile":null,"injectPolyfill":true,"outputFormat":"php","useDefaults":true},
CleanExtractedDeps: {},
WebpackRemoveEmptyScriptsPlugin: {"verbose":false,"extensions":["css","scss","sass","less","styl"],"scriptExtensions":["js","mjs"],"ignore":[]},
],
"resolve": Object {
"alias": Object {
Expand Down
2 changes: 2 additions & 0 deletions packages/toolkit/config/webpack/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const StyleLintPlugin = require('stylelint-webpack-plugin');
const WebpackBar = require('webpackbar');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts');
const CleanExtractedDeps = require('../../utils/clean-extracted-deps');

const { hasStylelintConfig, fromConfigRoot, hasProjectFile } = require('../../utils');
Expand Down Expand Up @@ -101,5 +102,6 @@ module.exports = ({
injectPolyfill: true,
}),
new CleanExtractedDeps(),
new RemoveEmptyScriptsPlugin(),
].filter(Boolean);
};
1 change: 1 addition & 0 deletions packages/toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"webpack": "^5.41.1",
"webpack-bundle-analyzer": "^4.4.2",
"webpack-dev-server": "^3.11.2",
"webpack-remove-empty-scripts": "^0.7.1",
"webpack-sources": "^2.3.0",
"webpackbar": "^5.0.0-3"
},
Expand Down

0 comments on commit 789ddee

Please sign in to comment.