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

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
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)


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


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 : '');
  1. 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!


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  :(