如何仅在生产模式下使用webpack集成bootstrap的cdn

时间:2018-01-31 13:13:52

标签: webpack webpack-dev-server webpack-3

您好我正在使用htmlwebpackextract插件。这是我的配置代码

new HtmlWebpackExternalsPlugin(
            {
            externals: [
                {
                    module: 'jquery',
                    entry:'https://unpkg.com/jquery@3.2.1/dist/jquery.min.js',
                    global: 'jQuery'
                },
                {
                    module: 'bootstrap',
                    entry: {
                        path: 'https://unpkg.com/bootstrap@4.0.0/dist/css/bootstrap.min.css',
                        type: 'css'
                    },
                    append: true,
                }
            ],
            enabled:isProd,
            }

        )

它给出了一些错误,因为无法读取属性'var'of null。在index.js require('bootstrap')就在那里

0 个答案:

没有答案
相关问题