0
我以「傳統方式」創建了一個小項目,我想集成webpack。該項目使用angularjs和bootstrap。如何將webpack集成到傳統結構項目中?
我不想修改我的代碼庫。我僅捆綁js文件。
module.exports = {
entry: {
app: './src/main.js',
others: ['...', '...']
vendor: [
'jquery',
'bootstrap',
'angular',
'angular-route'
]
},
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].bundle.js'
},
plugins: [
new webpack.ProvidePlugin({
'$': 'jquery',
'jQuery': 'jquery',
'window.jQuery': 'jquery'
})
]}
在index.html的我只是包括app.bundle.js,others.bundle.js和vendor.bundle.js。
構建工程。但當然,引導js代碼不會被執行(所以導航欄切換不適用於小設備)。有沒有辦法使它與引導工作?我必須要求/進口bootstrap嗎?