Skip to content
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

Working around missing manifest.json bug #901

Merged
merged 1 commit into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1421,11 +1421,11 @@ class Encore {
* // common values: asset, asset/resource, asset/inline
* // Using "asset" will allow smaller images to be "inlined"
* // instead of copied.
* // javascript/auto caan be used to disable asset images (see next example)
* // javascript/auto can be used to disable asset images (see next example)
* type: 'asset/resource',
*
* // applicable when for "type: asset": files smaller than this
* // size will be "inlined" into CSS, larer files will be extracted
* // size will be "inlined" into CSS, larger files will be extracted
* // into independent files
* maxSize: 4 * 1024, // 4 kb
*
Expand Down
5 changes: 5 additions & 0 deletions lib/plugins/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ module.exports = function(plugins, webpackConfig) {
return;
}

const cleanOnceBeforeBuildPatterns = webpackConfig.cleanWebpackPluginPaths;
// works around a bug where manifest.json is emitted when
// using dev-server... but then CleanWebpackPlugin deletes it
cleanOnceBeforeBuildPatterns.push('!manifest.json');

const cleanWebpackPluginOptions = {
verbose: false,
cleanOnceBeforeBuildPatterns: webpackConfig.cleanWebpackPluginPaths,
Expand Down
4 changes: 2 additions & 2 deletions test/plugins/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('plugins/clean', () => {
cleanPluginUtil(plugins, config);
expect(plugins.length).to.equal(1);
expect(plugins[0].plugin).to.be.instanceof(CleanWebpackPlugin);
expect(plugins[0].plugin.cleanOnceBeforeBuildPatterns).to.deep.equal(['**/*']);
expect(plugins[0].plugin.cleanOnceBeforeBuildPatterns).to.deep.equal(['**/*', '!manifest.json']);
expect(plugins[0].plugin.dry).to.equal(false);
});

Expand All @@ -56,7 +56,7 @@ describe('plugins/clean', () => {
cleanPluginUtil(plugins, config);
expect(plugins.length).to.equal(1);
expect(plugins[0].plugin).to.be.instanceof(CleanWebpackPlugin);
expect(plugins[0].plugin.cleanOnceBeforeBuildPatterns).to.deep.equal(['**/*.js', '**/*.css']);
expect(plugins[0].plugin.cleanOnceBeforeBuildPatterns).to.deep.equal(['**/*.js', '**/*.css', '!manifest.json']);
expect(plugins[0].plugin.dry).to.equal(true);
});

Expand Down