Skip to content

webpack output.publicPath not supported? #102

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

Closed
thescientist13 opened this issue May 29, 2019 · 3 comments
Closed

webpack output.publicPath not supported? #102

thescientist13 opened this issue May 29, 2019 · 3 comments

Comments

@thescientist13
Copy link
Contributor

thescientist13 commented May 29, 2019

Was trying this out to see to experiment with some of its capabilities, in particular output configuration.

My project is based off of a fresh Angular 7 generated CLI project.

# webpack.partial.js
const path = require('path');
const version = require('./package.json').version;
const webpack = require('webpack');

module.exports = {

  output: {
    path: path.join(__dirname, 'public/web/my-app'),
    publicPath: 'my-app',
    hashDigest: 32
  },

  plugins: [
    new webpack.DefinePlugin({
      "VERSION": JSON.stringify(version)
    })
  ]
}
  • The build is output in my custom directory public/web/my-app- ✅
  • Hash digest works - ✅
  • Public path is not updated in index.html. Would have expected my-app/ to show up in the <script> and <style> paths 🚫
<link rel="stylesheet" href="styles.9047fa032743264be619.css"></head>
<body>
  <app-root></app-root>
<script type="text/javascript" src="runtime.c64d190961200391e282.js"></script><script type="text/javascript" src="es2015-polyfills.bda95d5896422d031328.js" nomodule></script><script type="text/javascript" src="polyfills.d91e69fec887938f5ab6.js"></script><script type="text/javascript" src="main.c65bc31d07c211cc14ea.js"></script></body>
</html>

Thanks and let me know if you know any more info, I think this tool can definitely be a game changer for the Angular ecosystem!! 💪

@thescientist13
Copy link
Contributor Author

thescientist13 commented Jun 24, 2019

Did some searching, it appears this can be done through the Angular CLI directly, using --deploy-url public/static as per angular/angular-cli#2276 (comment)

Doing a little more testing but might be able to close this.

@thescientist13
Copy link
Contributor Author

thescientist13 commented Jun 28, 2019

Looks like --deploy-url is working for me, so can close this. Thanks for the great tool! 🎉

@izogfif
Copy link

izogfif commented Mar 4, 2024

--deploy-url is now deprecated since Angular 13. Apparently, the need to do this via ngx-build-plus arises once again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants