在这一章中,我们对除了引入 bootstrap 还会对其他地方进行升级。
目录如下
.
|___dist
|___node_modules
|___src
|______index.html
|______index.js
|___.babelrc
|___package.json
|___package-lock.json
|___webpack.config.js参考资料
在单独使用 tensorflow.js 的时候,参考
配置文件
package.json
内容如下
| 1 | { | 
这里有一个最大的区别就是将上一次的
"type": "module",去掉了,参考
webpack.config.js
这里面的内容如下
| 1 | let path = require('path'); | 
.babelrc
babel 参考
babel 的配置文件如下
| 1 | { | 
如果运行上面的脚本
npm run build会在 dist 文件夹下生成
- bundle.js
- style.css
code
index.js
内容如下
| 1 | import 'bootstrap'; // 引入 Bootstrap | 
index.html
| 1 | <html> | 
 
        