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

Asset modules assetModuleFilename #7009

Open
lbineau opened this issue Feb 24, 2022 · 2 comments
Open

Asset modules assetModuleFilename #7009

lbineau opened this issue Feb 24, 2022 · 2 comments

Comments

@lbineau
Copy link

lbineau commented Feb 24, 2022

What problem does this feature solve?

Vue CLI 5 now relies on Webpack 5 and leverage assets with asset-modules https://webpack.js.org/guides/asset-modules/
This new module seems to simplify the configuration but as far as I know it is impossible to customize "assetModuleFilename" property with Vue CLI.
It could be useful to only modify the asset ouput base directory rather than having to modify them for each single loader.

What does the proposed API look like?

Allow the following configuration:

ouput: {
  assetModuleFilename
}
@lbineau
Copy link
Author

lbineau commented Feb 28, 2022

I'm answering my own question if someone has the same issue.
It should be possible to do so by modifying webpack config.

chainpack seems not to be ready for webpack 5.x yet (I wonder how Vue CLI 5.x leverage it): neutrinojs/webpack-chain#297

module.exports = {
  chainWebpack: config => {
    config.output.assetModuleFilename('[hash][ext][query]')
  }
}

In the meantime we can use configureWebpack

module.exports = {
  configureWebpack: {
    output: {
      assetModuleFilename: 'resources/[hash][ext][query]'
    }
  },
}

@lbineau lbineau closed this as completed Feb 28, 2022
@lbineau
Copy link
Author

lbineau commented Feb 28, 2022

I was hoping this to solve my issue as it did for chunkFilename but unfortunately not

@lbineau lbineau reopened this Feb 28, 2022
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

1 participant