我花了兩天的時間嘗試使用Webpack將Bootstrap捆綁在一起。我已經讓jQuery工作,但爲了使Bootstrap充分運作,我們還需要Tether來工作(在我的情況下 - 用於彈出)。我跟着this guide以及this package。仍然,問題仍然存在,我得到的錯誤告訴我,popover不是一個功能。與Webpack綁定時無法使引導程序4使用Tether工作
我的配置看起來像這樣。
var webpack = require("webpack");
module.exports = {
entry: ["babel-polyfill", "./index.js"],
//entry: ["babel-polyfill", "./index.js", "tether"],
output: { path: __dirname, filename: "bundle.js" },
plugins: [new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
jquery: "jquery",
"window.$": "jquery",
"window.jQuery": "jquery",
"window.jquery": "jquery",
"Tether": "tether",
"window.Tether": "tether",
// Popover: "exports?Popover!bootstrap/js/dist/popover",
})],
...
}
在最後幾天的過程中,我嘗試了幾乎所有的東西,而且我沒有彈藥。我如何進一步排除故障?
還有其他similar issues未解決,但也似乎get Tether unwillingly。我在那我可以哭的那一刻如此混亂...
我不需要這個配置,你可以看到我的例子[這裏](https://github.com/mimani/vue-example/tree/popover-example)與webpack。我只是在[index.html](https://github.com/mimani/vue-example/blob/popover-example/index.html#L11)中導入它,並且它工作正常。 – Saurabh
@saurabh我在* package.json *中看不到Tether(或Bootstrap,在我的情況下是需要Tether的)。我們在談論相同的* popover()*嗎? –
我在說這個:https://v4-alpha.getbootstrap.com/components/popovers/ – Saurabh