shirotech/webpack-cdn-plugin

Plug-in cannot customize CDN server address

umbrella22 opened this issue · 2 comments

Due to poor access to unpkg.com in some areas of mainland China's network, I need to change my CDN address to cdn.bootcss.com, but this configuration does not seem to work. Is my method incorrect?

    const WebpackCdnPlugin = require('webpack-cdn-plugin');
    options.plugins.push(new WebpackCdnPlugin({
        modules: {
            'vue': [{
                name: 'vue',
                cdn: 'https://cdn.bootcss.com/',
                path: 'dist/vue.runtime.min.js'
            }]
        }
    }))

Please give me some advice.

Hi @umbrella22 I think what you're looking for is prodUrl https://github.com/shirotech/webpack-cdn-plugin#produrlstring--unpkgcomnameversionpath rather than cdn (perhaps thats's not the best name for it). The cdn option is for changing the package name if it's different to npm.

Oh, I should have read the whole document. I misunderstood the meaning. Thank you for your busy reply. @shirotech