Сейчас разбираюсь с webpack, поставил перед собой цель собрать bootstrap4 в bundle, без ручной правки index.html.
webpack.config.js
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry : "./entry.js",
output: {
path: 'dist',
filename: 'bundle.js'
},
plugins: [new HtmlWebpackPlugin({
title : "My App",
hash : true
})],
module: {
loaders: [
{ test: /\.css$/, loader: "style-loader!css-loader" }
]
}
};
package.json
{
"name": "webpackStudy",
"devDependencies": {
"css-loader": "^0.25.0",
"html-webpack-plugin": "^2.22.0",
"style-loader": "^0.13.1"
},
"dependencies": {
"bootstrap": "^4.0.0-alpha.4"
}
}
entry.js
require("./node_modules/jquery/dist/jquery.min.js");
require("./node_modules/tether/dist/js/tether.min.js");
require("./node_modules/bootstrap/dist/js/bootstrap.min.js");
require("./node_modules/tether/dist/css/tether.min.css");
require("./node_modules/bootstrap/dist/css/bootstrap.min.css");
Как управлять порядком зависимостей? Можно ли записать зависимости непосредственно в webpack.config.js?
Если не трудно, - прошу помочь разобраться.