如何把bootstrap用webpack打包

2025-04-28 22:47:47
推荐回答(1个)
回答1:

# 第1步安装bootstrap-loader

npm install bootstrap-loader --save

# 第2步 如果你使用的是Bootstrap3

npm install bootstrap-sass --save

#如果你使用的是Bootstrap4
npm install bootstrap@v4.0.0-alpha.2 --save

# 我发现npm下载不了bootstrap4,所以我是从网上下载下来的,然后放到
# node_modules下的,下载地址http://v4.bootcss.com/getting-started/download/

# 第四步 安装其他样式处理loader

npm install css-loader node-sass resolve-url-loader sass-loader style-loader url-loader --save

# 如果你使用的是Bootstrap 4,可能会需要

npm install postcss-loader --save

# 我的提示没有 flie-loader,所以我安装了 flie-loader

npm install flie-loader --save