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

Custom injected cdn file location #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AlexStacker
Copy link

Add the extra html-webpack-plugin option assetsCdnName:

plugins:[
// ...otherConfig
new HtmlWebpackPlugin({
      title: 'title',
      assetsCdnName: 'cdn',
      favicon: 'path/to/favicon',
      template: 'path/to/template',
      filename: 'filename',
      // other config
 }),
 new WebpackCdnPlugin({
   modules: [
      { name: 'react', var: 'React', path: `dist/react.min.js` },
      { name: 'react-dom', var: 'ReactDOM', path: `dist/react-dom.min.js` },
    ]
 })
]
<% htmlWebpackPlugin.files.cdn.js.forEach(function(link){ %>
    <script src="<%= link %>"></script>
<% }) %>

So I can put the cdn link at the top of all the files.

@shirotech
Copy link
Owner

Sorry didn't get to this PR soon enough, are you able to rebase and fix to pass all tests?

@Amberg
Copy link

Amberg commented Dec 22, 2020

This feature would be great

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

Successfully merging this pull request may close these issues.

None yet

3 participants