如何把bootstrap用webpack打包

今天下载了一个anguarl2写后台,一直没有找到是如何使用bootstrap样式的,然后就全文做了搜索,发现有一段代码

import 'bootstrap-loader';

这段代码很可疑,所以就查了一下,发现确实是bootstrap-loader将bootstrap引入的。

# 第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

 

 

以下是相关资料

https://www.npmjs.com/package/bootstrap-loader

https://github.com/shakacode/bootstrap-loader

https://github.com/shakacode/bootstrap-loader/blob/master/examples/basic/package.json

转载于:https://www.cnblogs.com/liuyt/p/5708508.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值