-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
@wordpress/scripts deletes files #24111
Comments
What I've done instead (for now at least) is not used The files going missing were in
webpack.config.jsconst DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' );
var config = {
entry: './index.js',
output: {
path: __dirname,
filename: 'block.build.js',
},
module: {
rules: [
{
test: /\/stories\/.+\.js$/,
loaders: [ require.resolve( '@storybook/source-loader' ) ],
enforce: 'pre',
},
{
test: /.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
{
test: /.scss$/,
loader: 'sass-loader',
}
],
},
plugins: [],
};
module.exports = (env, argv) => {
if (argv.mode === 'development') {
config.devtool = 'source-map';
}
if(process.env.WP_NO_EXTERNALS) {
config.plugins.push(
new DependencyExtractionWebpackPlugin( {
injectPolyfill: true,
outputFormat: 'json'
})
);
}
return config;
}; It seems to have fixed the issue for-now. I may have to spend a lot more time to bring the repo (2017 I think) in-line with 2020 😁 |
I also can't think of why https://www.npmjs.com/package/clean-webpack-plugin would be the culprit. It's defaults and the usage seem to suggest this is something else. |
By default |
It looks like there is no action left. I will close this issue. @Lewiscowles1986, did you manage to resolve your issue by following the recommendation shared? |
Describe the bug
Following the instructions on
@wordpress/scripts
leads to files deleting themselves.To reproduce
Steps to reproduce the behavior:
@wordpress/scripts
npm (trying to reduce package size)npm run build
Expected behavior
Not deleting, reverting or modifying files without a prompt to confirm (minimize any user surprise)
Additional context
This is when using the
@wordpress/scripts
package at version12.1.1
windows 64-bit using vscode & git bash.The text was updated successfully, but these errors were encountered: