Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Webpack Configuration (webpack.config.js)


Good day! I was wondering what the optimal way to edit webpack.config.js would be in order to have it direct the output to a different project folder besides a demo folder. I have a folder called "project" that's currently in the same parent folder that demo1 is in. It is a PHP project using Metronic 8.2.0. Thank you!


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


To configure Webpack to direct the output to a different project folder besides the demo folder, you can make the following changes in the `webpack.config.js` file:

1. Locate the `demoPath` variable within the `webpack.config.js` file. It should look something like this:


const demoPath = rootPath + (demo ? "/" + demo : "");


2. Update the `demoPath` variable to point to your "project" folder. Modify it to be:


const demoPath = rootPath + "/project";


By making this change, you're instructing Webpack to output the built files to the "project" folder instead of the demo folder. Ensure that the path is correctly specified to match the location of your PHP project.

After making this adjustment, you should be able to build and output the files to your "project" folder as desired.



Thank you very much!



You're very welcome! If you have any more questions or need further assistance in the future, feel free to reach out.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(