-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scripts: "No entry files discovered in the "src" folder" with entry
context in webpack.config.js
#38739
Comments
I have a fix ready for review and testing: #38737. |
|
@gziolo @ocean90 We do have Why is /**
* External dependencies
*/
const path = require( 'path' );
const RtlCssPlugin = require( 'rtlcss-webpack-plugin' );
/**
* WordPress dependencies
*/
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
module.exports = {
...defaultConfig,
context: path.resolve( __dirname, 'client' ),
entry: {
index: './index.js',
},
output: {
...defaultConfig.output,
chunkFilename: 'chunks/[name].js',
},
resolve: {
...defaultConfig.resolve,
modules: [ path.join( __dirname, 'client' ), 'node_modules' ],
},
plugins: [
...defaultConfig.plugins,
new RtlCssPlugin( {
filename: '[name]-rtl.css',
} ),
],
}; |
@gziolo Can you help me with the ^ comment? Thanks in advance! |
Yes, it still need a fix for your use case. I commented about a potential solution here: #39618 (comment). It’s only a message, your code should work correctly. |
The @wordpress/scripts package above version 21.0.2 doesn't extend the default config entries in webpack config file. Instead, the custom entry points will replace all of the default entries. The issue is described here WordPress/gutenberg#38739 . It is appeared that the issue is marked as closed but the problem still persists. This commit downgrades the @wordpress/scripts back to 21.0.2 to allow custom entry build points.
Description
With 21.0.0 of @wordpress/scripts its no longer possible to use the
entry
context inwebpack.config.js
because the default config now uses anexit()
call ingutenberg/packages/scripts/utils/config.js
Lines 271 to 274 in 29d123b
That's quite unfortunate and IMO not necessary. The exit should either be removed or first checked if an
entry
setting is set inwebpack.config.js
.Step-by-step reproduction instructions
@wordpress/scripts
webpack.config.js
with a customentry
settingwp-scripts start
Screenshots, screen recording, code snippet
Example of a webpack config:
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: