Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Metronic 8 - Webpack.config - Deleting of assets


In the webpack.config there is this method below that takes care of deleting the assets but I am not sure why it is restricted by that if condition. I mean if I run 'npm run build' I expect that the dist/asstets folder will be totally deleted first and then redone so if for instance I had some images in the src/media folder that I have removed then they will also be removed from the dist/assets folder and not stay there which can cause false impressions.

To make matter worse when I ran: 'npm run localhost', that if condition still wasn't hit.


function removeExistingAssets() {
if (typeof args.localhost !== 'undefined') {
del(distPath, {force: true});
}
}


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Thank you for pointing it out. The changes should be included in the latest release. We appreciate your help.

Thanks



Ok thanks, that makes a bit more sense in my eyes not sure why it was wrong in the first place...



Hi,

We will fix it. It should be like this.


if (typeof args.localhost === "undefined") {
...


When running localhost, we exclude the delete function.

Thanks


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(